Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Another place where the Dalvik garbage collector messages are explained is in this video: <a href="http://www.youtube.com/watch?v=_CruQY55HOk">Google I/O 2011: Memory management for Android Apps</a></p> <p>At about 14 minutes into the presentation, he breaks down the message format. (BTW, that video has really good info on debugging memory leaks)</p> <p>Roughly speaking, the format is <code>[Reason] [Amount Freed], [Heap Statistics], [External Memory Statistics], [Pause Time]</code></p> <h2>Reason</h2> <p>Viktor/Robert already explained <code>GC_CONCURRENT</code>, <code>GC_FOR_MALLOC</code>, <code>GC_EXTERNAL_ALLOC</code>.</p> <p>There is also:</p> <ul> <li><p><code>GC_HPROF_DUMP_HEAP</code> - If you dump heap by clicking the "dump heap" button from DDMS or programatically</p></li> <li><p><code>GC_EXPLICIT</code> - If you call System.gc()</p></li> </ul> <h2>Amount Freed</h2> <p>E.g. <code>freed 2125K</code></p> <p>Self explanatory</p> <h2>Heap Statistics</h2> <p>E.g. <code>47% free 6214K/11719K</code></p> <p>These numbers reflect conditions after the GC ran. The "47% free" and 6214K reflect the current heap usage. The 11719K represents the total heap size. From what I can tell, the heap can grow/shrink, so you will not necessarily have an OutOfMemoryError if you hit this limit.</p> <h2>External Memory Statistics</h2> <p>E.g <code>external 7142K/8400K</code></p> <p>Note: This might only exist in pre-Honeycomb versions of Android (pre 3.0).</p> <p>Before Honeycomb, bitmaps are allocated external to your VM (e.g. Bitmap.createBitmap() allocates the bitmap externally and only allocates a few dozen bytes on your local heap). Other examples of external allocations are for java.nio.ByteBuffers.</p> <h2>Pause Time</h2> <p>If it's a concurrent GC event, there will be two times listed. One is for a pause before the GC, one is for a pause when the GC is mostly done. E.g. <code>paused 3ms+5ms</code></p> <p>For non-concurrent GC events, there is only one pause time and it's typically much bigger. E.g. <code>paused 87ms</code></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload