1

I made a java app for android 2.3.4 and would like to find out how much memory of the available heap it is using.

Reason for that is that the dalvik vm has a heap size limit and on my current device that limit is 32mb but I would also want to run it on devices with a heap size of only 16mb and need to find out if I have to make memory optimizations.

How can I find out how much of the current heap size is being used?


Edit: I did find (with the help of the answer) some useful pointers here:

http://android-developers.blogspot.jp/2011/03/memory-analysis-for-android.html

trincot
  • 317,000
  • 35
  • 244
  • 286
HardCoder
  • 3,026
  • 6
  • 32
  • 52
  • Possibly duplicate of http://stackoverflow.com/questions/2298208/how-to-discover-memory-usage-of-my-application-in-android – Justin Breitfeller Apr 16 '12 at 20:14
  • Thats not really a "duplicate" because I want to find out how much memory of the heap is being counted against the heap limit in the dalvik vm. – HardCoder Apr 16 '12 at 22:35

1 Answers1

3

DDMS supports tracking the heap size. Have a look here under "Viewing heap usage for a process"

207
  • 3,784
  • 2
  • 25
  • 22