简体   繁体   English

UseConcMarkSweepGC详细的gc输出显示内存下降

[英]UseConcMarkSweepGC verbose gc output shows memory drops

I have an application for which I have enabled GC logging. 我有一个已启用GC日志记录的应用程序。 The heap appears to grow then takes a sudden drop, but does not log a Full GC. 堆似乎会增长,然后突然下降,但不会记录完整GC。 If there some startup parameter that I can enable that will show me what GC event is reducing the heap size? 如果有一些我可以启用的启动参数,它将告诉我哪个GC事件正在减小堆大小?

My environment: Linux 64-Bit, java 1.6.0_31, Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode) 我的环境: Linux 64位,java 1.6.0_31,Java HotSpot(TM)64位服务器VM(内部版本20.6-b01,混合模式)

VM args: -server -Xms2560m -Xmx2560m -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m -XX:-PrintGC -XX: -PrintGCDetails -XX:-PrintGCTimeStamps -Xloggc:/xxxxx/gc.log -Dsun.rmi.dgc.client.gcInterval=86400000 -Dsun.rmi.dgc.server.gcInterval=86400000 VM参数:-服务器-Xms2560m -Xmx2560m -XX:+ UseConcMarkSweepGC -XX:MaxPermSize = 256m -XX:-PrintGC -XX:-PrintGCDetails -XX:-PrintGCTimeStamps -Xloggc:/xxxxx/gc.log -Dsun.rmi.dgc .client.gcInterval = 86400000 -Dsun.rmi.dgc.server.gcInterval = 86400000

3057.609: [GC 2397254K->2385777K(2619328K), 0.0572310 secs]
3058.898: [GC 2402801K->2391301K(2619328K), 0.0566620 secs]
3059.940: [GC 2408325K->2397156K(2619328K), 0.0534080 secs]
3059.995: [GC 2397265K(2619328K), 0.0069950 secs]
3065.635: [GC 2414180K->2404934K(2619328K), 0.0732700 secs]
3065.849: [GC 2419994K(2619328K), 0.1150630 secs]
3070.248: [GC 1593931K->1591825K(2619328K), 0.1084230 secs]
3072.440: [GC 1608552K->1606431K(2619328K), 0.0533140 secs]
3087.759: [GC 1623455K->1614544K(2619328K), 0.0215850 secs]

What event is causing the heap to shrink between the output at 3065.849 and 3070.248? 什么事件导致堆在3065.849和3070.248之间的输出之间收缩? Is there a VM param that will log it? 是否有将记录它的VM参数? I tried adding -verbose:gc but that does not change the output. 我尝试添加-verbose:gc,但这不会更改输出。

GC happens in two steps GC分两步进行

1) Minor collection (cleans mostly younger generation) 1)次要收藏(主要清洁年轻一代)

2) Major collection 2)主要收藏

I guess what you are seeing there is minor collection. 我想您会看到有少量收藏。 This tutorial may help you in understanding these terminologies. 教程可以帮助您理解这些术语。

Mark's comment had the right answer, I was not enabling the Details properly. 马克的评论有正确的答案,我没有正确启用“详细信息”。 Now I see the event: 现在我看到了这个事件:

5505.399: [GC 5505.399: [DefNew: 17273K->1942K(19136K), 0.0172730 secs] 2408937K->2393606K(2619328K), 0.0175180 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
5524.922: [GC 5524.922: [DefNew: 18948K->2111K(19136K), 0.0268990 secs] 2410612K->2395349K(2619328K), 0.0271850 secs] [Times: user=0.02 sys=0.01, real=0.03 secs]
5524.950: [GC [1 CMS-initial-mark: 2393237K(2600192K)] 2395413K(2619328K), 0.0088880 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
5524.959: [CMS-concurrent-mark-start]
5527.608: [CMS-concurrent-mark: 2.645/2.650 secs] [Times: user=2.62 sys=0.00, real=2.65 secs]
5527.609: [CMS-concurrent-preclean-start]
5527.624: [CMS-concurrent-preclean: 0.015/0.015 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
5527.625: [GC[YG occupancy: 3557 K (19136 K)]5527.625: [Rescan (non-parallel) 5527.625: [grey object rescan, 0.0065690 secs]5527.632: [root rescan, 0.0088130 secs], 0.0154260 secs]5527.641: [weak refs processing, 0.1026480 secs] [1 CMS-remark: 2393237K(2600192K)] 2396795K(2619328K), 0.1252390 secs] [Times: user=0.13 sys=0.00, real=0.13 secs]
5527.954: [CMS-concurrent-sweep-start]
5531.258: [CMS-concurrent-sweep: 3.304/3.304 secs] [Times: user=3.15 sys=0.02, real=3.30 secs]
5531.258: [CMS-concurrent-reset-start]
5531.264: [CMS-concurrent-reset: 0.006/0.006 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]  
5551.660: [GC 5551.660: [DefNew: 19135K->1234K(19136K), 0.0691830 secs] 1373830K->1357833K(2619328K), 0.0694780 secs] [Times: user=0.07 sys=0.00, real=0.07 secs]
5584.991: [GC 5584.991: [DefNew: 18257K->2111K(19136K), 0.0264920 secs] 1374857K->1360277K(2619328K), 0.0267850 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
5589.794: [GC 5589.794: [DefNew: 19135K->286K(19136K), 0.0189210 secs] 1377301K->1359264K(2619328K), 0.0191450 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
5632.424: [GC 5632.424: [DefNew: 17310K->2111K(19136K), 0.0182480 secs] 1376288K->1361326K(2619328K), 0.0185900 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
5645.086: [GC 5645.087: [DefNew: 19135K->2112K(19136K), 0.0276910 secs] 1378350K->1363056K(2619328K), 0.0279740 secs] [Times: user=0.03 sys=0.00, real=0.03 secs]

Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM