Reputation: 21
I try to debug an Android application which has an out of memory error. The app cannot allocate 3Mbytes in some condition. I analyze the adb log, there are some debug output of dalvikvm as below:
dalvikvm: GC_FOR_MALLOC freed <1K, 47% free 4781K/8967K, external 55469K/57517K, paused 64ms
dalvikvm: GC_EXTERNAL_ALLOC freed <1K, 47% free 4781K/8967K, external 55469K/57517K, paused 80ms
dalvikvm: GC_FOR_MALLOC freed 0K, 47% free 4781K/8967K, external 55469K/57517K, paused 39ms
I compare the number in above output with the number in "Heap" window of DDMS. "free 4781K/8967K" seems corresponding to "Allocated" and "Heap size" in "Heap" of DDMS. However, I'm not sure what is "external 55469K/57517K". I suspect that it is memory allocated by native code. Does anybody know this?
Upvotes: 0
Views: 1605
Reputation: 16839
It's complicated, so says this Android platform engineer:
How do I discover memory usage of my application in Android?
3mb is a lot for an Android app, the starting heaps are pretty small, ~16-32mb.
Upvotes: 1