Garbage collection in dalwick vm

I connect my Android phone to the eclipse. And I see this message from Logcat. Could you tell me what is the difference between "GC_EXPLICIT" and "GC_EXTERNAL_ALLOC" and what does "45% free" mean?

10-05 12:08:34.450: DEBUG/dalvikvm(813): GC_EXTERNAL_ALLOC freed 63K, 45% free 3156K/5703K, external 4113K/4348K, paused 73ms 10-05 12:08:34.480: DEBUG/dalvikvm(101): GC_EXTERNAL_ALLOC freed 55K, 40% free 5883K/9799K, external 4911K/4913K, paused 124ms 10-05 12:08:37.120: DEBUG/dalvikvm(101): GC_EXPLICIT freed 84K, 41% free 5870K/9799K, external 5745K/6078K, paused 104ms 10-05 12:08:40.099: DEBUG/dalvikvm(493): GC_EXPLICIT freed 14K, 48% free 3782K/7175K, external 1625K/2137K, paused 75ms 10-05 12:08:45.110: DEBUG/dalvikvm(188): GC_EXPLICIT freed 57K, 54% free 3203K/6855K, external 4988K/6206K, paused 78ms 10-05 12:09:05.119: DEBUG/dalvikvm(822): GC_EXPLICIT freed 349K, 46% free 3696K/6727K, external 1625K/2137K, paused 65ms 
+6
source share
2 answers

I would really like to offer a video presentation of Memory Management from Google I / O 2011 to watch:

http://www.youtube.com/watch?v=_CruQY55HOk

After about 14 minutes, he delves into what they mean in logcat output.

GC Explicit basically means that the application is explicitly called System.gc ();

The GC Concurrent starts when your heap starts to fill up, and the Concurrent GC starts to reliably clear the memory before it is full.

+9
source

GC_EXPLICIT means that your application explicitly called System.gc () or the Activity Manger of an Android system called System.gc ()

GC_EXTERNAL_ALLOC is something more complex. There is some memory associated with the lifetime of a Java object called EXTERNAL memory. Such as memory usage of the graphic or pixel resources of your application. This type of memory allocation uses the "malloc" stdlib to allocate memory heaps, but does NOT allocate from GC Heap Dalvik, but it is also one of the HEAP memory. And the overall use of HEAP size should be less than the limit (decide GC).

Dalvik tracking for this memory.

 CONDITION: usableof(GC_HEAP) + usableof(NATIVE_HEAP[external]) <= allocaionLimit 

Dalvik will invoke the GC for GC_EXTERNAL_ALLOC as a side effect if the above condition is not true.

+1
source

Source: https://habr.com/ru/post/898699/


All Articles