How can one track memory consumption in Android? The Android "Heap"
view in Eclipse and java.lang.Runtime methods seem failing for my
purpose.

I tried to figure out how much memory my app consumes in order to make
decisions for future directions. Most of the memory goes into Bitmap
objects. Just to test memory consumption I created huge bitmaps in a
Loop and logged the java.lang.Runtime memory values:
created bitmap (610k free, 2371k total, 16384k max)
created bitmap (615k free, 2371k total, 16384k max)
created bitmap (615k free, 2371k total, 16384k max)
created bitmap (615k free, 2371k total, 16384k max)

Nothing seems to hapen, but on the fifth Bitmap:
java.lang.OutOfMemoryError: bitmap size exceeds VM budget
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:343)
    at de.greenrobot.colorball.GameView.init(GameView.java:86)

This seems confusing at first. Is java.lang.Runtime the right place to
check application memory stats in Android at all? Are Bitmaps
allocated outside the app's heap? How can I track it?

Thanks
Markus

--
http://greenrobot.de
http://jars.de

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to