One, Gc_reason triggers the collection of garbage collection reasons:
type |
Description |
Gc_concurrent |
When memory usage is full, concurrent garbage collection occurs. |
Gc_for_malloc |
Garbage collection is triggered when a memory full application tries to allocate memory, so the system stops the app from being garbage collected |
Gc_hprof_dump_heap |
Garbage collection is triggered when the Hprof file is created to parse memory. |
Gc_explicit |
Show garbage collection, for example when you call GC () (should avoid calling, but be referred to the system for processing) |
Gc_external_alloc |
Will only be triggered in the following versions of API 10. The new version will only be allocated on the Dalvik heap. |
Second, Amount freed the size of the recovered memory
Iii. Heap stats free memory ratio and (total number of active objects/memory size)
Iv. External Memory Stats API 10 size
The greater the pause time, the longer the heap pauses, two pauses are displayed: One is the start time of the collection and the other is the end time of the collection
Example: D/DALVIKVM (27235): Gc_for_alloc freed 836K, 27% free 9653k/13116k, paused 101ms, total 104ms
Log Information |
Description |
Freed 836K |
This recycling 836K |
27% Free |
Free memory Space 27% |
9653k/13116k |
Active objects and total size specifically refer to |
Paused 101ms |
Time to suspend garbage collection 101ms |
Total 104ms |
Total Elapsed Time 104ms |
Other external 0k/0k, which represents the total amount of available external memory/external memory paused 2ms+2ms, the first time value represents the time of Markrootset, and the second time value represents the time of the second mark. If the trigger reason is not gc_concurrent, this behavior is a single time value that represents the time-consuming period of garbage collection.
Can be filtered by "gc_" keyword + TAG two in Logcat
Reference: Https://developer.android.com/tools/debugging/debugging-memory.html#LogMessages
Android Memory Analysis tool-LogCat GC