Thanks Michael for your reply. On Mar 27, 12:07 am, Michael MacDonald <googlec...@antlersoft.com> wrote: > AFAIK, bitmaps *are* created outside the Java heap, and there is a limit > of 16MB imposed on the *sum* of the Java heap and the total of the > allocated bitmaps. So, does this mean, that there is currently no instrumentation for a reliable memory tracking in Android as of today? If the sum of Java and "native" heap counts, it would very helpful to have this value accessible. From another viewpoint one could say the jav.lang.Runtime memory stats are buggy because they do not count all resources. Which leads to the next question: which resources are invisible to the memory stats? I bet all media resources fall in this category.
> I don't know what you can look at to tell exactly how big the bitmap is, > but I think they are essentially the size you think they would be: i.e., > 4 bytes per pixel for 24-bit color 8-bit alpha. Yup, trying to approximate it yourself seems the only option left. :\ In my test case each Bitmap was around 2.4 MB (1664x768 16 bit, no alpha). On the fifth, when it crashed, it sums up to 12 MB. The java.lang.Runtime stats say that 2 MB are allocated by Java objects. So another ~2MB are missing. This may make sense, because at that point the app holds other resources as well. It does not sum up to 2 MB (only ~1 MB), but there may be memory fragmentation issues as well. Nevertheless, I would really appreciate a reliable memory instrumentation. Especially when one needs to debug when theory and practice do not fit together nicely like in my test case. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---