了解Android的GC消息 [英] Understanding Android GC Messages

查看:169
本文介绍了了解Android的GC消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下消息在我的目录下载,

I have the following message on my catlog,

GC_CONCURRENT freed 456K, 19% free 2753K/3360K, paused 5ms+9ms, total 378ms

我试图做最后的总价值感。我检查了网站上的其他相关GC问题,他们要么与并发GC或用于非并发GC单总暂停相关的两个暂停。为什么我有两个?并暂停5 + 9毫秒或378毫秒我的应用程序?究竟什么是总?

I am trying to make sense of the last value total. I've checked other GC related question on the site they either have two pauses associated with the concurrent GC or a single total pause for the non concurrent GC. Why do i have two? Did my app paused for 5+9 ms or 378 ms? What exactly is total?

推荐答案

GC_CONCURRENT :当堆越来越大触发。因此它可以及时回收内存所以堆不需要放大

GC_CONCURRENT: Triggered when the heap is growing. So it can reclaim memory in time so the heap doesn't need to be enlarged

GC_CONCURRENT 释放456K

这部分告诉你多少内存被这个GC扫释放

This part tells you how much memory was freed by this GC sweep

GC_CONCURRENT 释放456K,19%免费2753K / 3360K

GC_CONCURRENT freed 456K, 19% free 2753K/3360K

此部分告诉堆的多%如何是免费的,活的对象的大小和堆的总大小。因此,自由19%在上面的例子中,有2753Kmemory中使用,总的堆的大小是3360K

This part tells how much % of the heap is free, the size of the alive objects and the total size of the heap. So in the above example the 19% free, there is 2753Kmemory in use and the total heap size is 3360K.

在日志的最后一部分告诉你GC花了多长时间。在 GC_CONCURRENT 集合,你会看到2倍。一个在采集的开始,和一个在端

The last part of the log tells you how long the GC took. on a GC_CONCURRENT collection you will see 2 times. one at the beginning of the collection, and one at the end.

有关 N 上并发GC事件,只有一个暂停时间,它通常要大得多。例如。暂停378ms

For non-concurrent GC events, there is only one pause time and it's typically much bigger. E.g. paused 378ms

来源:

<一个href=\"https://sites.google.com/site/pyximanew/blog/androidunderstandingddmslogcatmemoryoutputmessages\" rel=\"nofollow\">https://sites.google.com/site/pyximanew/blog/androidunderstandingddmslogcatmemoryoutputmessages

里的东西都解释清楚的另一个地方...

Another place where things are explained clearly...

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

这篇关于了解Android的GC消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆