I've got an application that allocates and releases a lot of memory (mostly bitmaps). I'm very careful about releasing memory, etc, and the application never crashes for out of memory reasons. For any 2.x OS, Debug.getNativeHeapAllocatedSize() always returns something that makes sense. However, running the same app on 3.x, Debug.getNativeHeapAllocatedSize() keeps on increasing. In fact, on the XOOM, if I run the app long enough, the returned value goes way beyond the device heap (which is 256 MB). I was able to get it up to 350 MB before I stopped testing. At the same time, running the Eclipse Memory Analyzer, it shows no problem with memory whatsoever. Everything seems to be released as expected.
Now, I tend to believe the memory analyser, but what is going on with getNativeHeapAllocatedSize()? Is it just plain wrong, or do I not understand what it's giving me for Honeycomb? If it's wrong, then how can I find the amount of memory I'm using at runtime?
Thanks!