Android logs 'GC_EXTERNAL_ALLOC' 'GC_FOR_MALLOC'

后端 未结 2 1372
无人共我
无人共我 2020-12-13 04:34

While running my apps, I have got this kind of logs:

GC_EXTERNAL_ALLOC freed 2K, 38% free 8772K/14087K, external 17480K/17998K, paused 87ms
GC_

2条回答
  •  半阙折子戏
    2020-12-13 05:19

    I was also looking for this information.

    GC stands for garbage-collector, which collects unused objects during runtime of your app.

      • GC_EXTERNAL_ALLOC: Means that the VM is trying to reduce the amount of memory used collectable objects, to make room for non-collectable objects.
      • GC_FOR_MALLOC: Means that the GC was triggered because there wasn't enough memory left on the heap to perform an allocation. Might be triggered when new objects are being created.
      • GC_CONCURRENT: Triggered when the heap has reached a certain amount of objects to collect.
    1. I am guessing that the 38% free means that 38% of the heap is unused. 8772K would be the size of the used memory on the heap and 14087K would be the size of the heap.
    2. I don´t know, sorry.

    Please note that all of this information is based on a post from Robert on a similiar question posted here on stackoverflow. All credit (as long as this is correct) goes to Robert.

提交回复
热议问题