0

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?

skynet
  • 9,898
  • 5
  • 43
  • 52
user941884
  • 21
  • 5

1 Answers1

1

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.

Community
  • 1
  • 1
nmr
  • 16,625
  • 10
  • 53
  • 67