0

I am working on and Android app, and have noticed quite a large disparity between the heap size when I use an emulator, and the heap size when I use a real device.

I am using a Nexus 6, and a Nexus 6 emulator to test the app. When I use the real device, my heap size is around 40mb, and allocated is around 23mb.

However, when I use the emulator, my heap doesn't go above 8mb.

Why is there such a large difference?

Derik
  • 45
  • 6

1 Answers1

2

How large your heap is depends on your device, how much ram it has total and the device manufacturer. You probably set up your emulator with little ram, resulting in that a large heap on the emulator may be smaller than a normal heap on a real device.

Consider this stack overflow post:

Detect application heap size in Android

Community
  • 1
  • 1
JohanShogun
  • 2,956
  • 21
  • 30
  • Hey, thanks for the information. I checked out the link. So basically, it's not a problem that the heap size is so much larger? The maximum heap size for my emulator was set to 64mb. – Derik Jul 27 '15 at 19:18
  • It's not something that's wrong in your app, it may be a problem for you if you rely on a lot of ram though. Generally speaking a device with a smaller dpi need less ram per app as the bitmaps are smaller. – JohanShogun Jul 27 '15 at 19:33
  • If this answer helped you remember to accept and up vote it – JohanShogun Jul 27 '15 at 19:34