Android Memory Analysis tool-LogCat GC

Source: Internet
Author: User


D/DALVIKVM: <GC_Reason> <amount_freed>,
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.