即使旧版本不满一半,CMS标记备注的高数量也会暂停 [英] High Number of CMS mark remark pauses even though Old gen is not half full

查看:117
本文介绍了即使旧版本不满一半,CMS标记备注的高数量也会暂停的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解造成大量CMS标记和备注(其他阶段也是如此)的原因,平均约700毫秒,即使旧版本甚至不满一半。以下是GC配置和GCViewer的统计数据。

I am trying to understand the cause for high number of CMS marks and remarks(other phases as well) averaging around 700ms even though the old gen is not even half full.Following are the GC configurations and stats from GCViewer.

-Xms3g 
-Xmx3g 
-XX:NewSize=1800m 
-XX:MaxNewSize=1800m
-XX:MaxPermSize=256m
-XX:SurvivorRatio=8
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled

使用GC Viewer的摘要: http ://i.imgur.com/0IIbNUr.png

Summary using GC Viewer: http://i.imgur.com/0IIbNUr.png

GC日志

152433.761: [GC [1 CMS-initial-mark: 284761K(1302528K)] 692884K(2961408K), 0.3367298 secs] [Times: user=0.33 sys=0.00, real=0.34 secs] 
152434.098: [CMS-concurrent-mark-start]
152434.417: [CMS-concurrent-mark: 0.318/0.318 secs] [Times: user=1.38 sys=0.02, real=0.32 secs] 
152434.417: [CMS-concurrent-preclean-start]
152434.426: [CMS-concurrent-preclean: 0.008/0.009 secs] [Times: user=0.02 sys=0.00, real=0.01 secs] 
152434.426: [CMS-concurrent-abortable-preclean-start]
 CMS: abort preclean due to time 152439.545: [CMS-concurrent-abortable-preclean: 4.157/5.119 secs] [Times: user=5.82 sys=0.20, real=5.12 secs] 
152439.549: [GC[YG occupancy: 996751 K (1658880 K)]152439.550: [Rescan (parallel) , 0.5383841 secs]152440.088: [weak refs processing, 0.0070783 secs]152440.095: [class unloading, 0.0777632 secs]152440.173: [scrub symbol & string tables, 0.0416825 secs] [1 CMS-remark: 284761K(1302528K)] 1281512K(2961408K), 0.6771800 secs] [Times: user=3.35 sys=0.02, real=0.68 secs] 
152440.227: [CMS-concurrent-sweep-start]
152440.613: [CMS-concurrent-sweep: 0.382/0.386 secs] [Times: user=0.39 sys=0.01, real=0.39 secs] 
152440.613: [CMS-concurrent-reset-start]
152440.617: [CMS-concurrent-reset: 0.004/0.004 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
152441.719: [GC [1 CMS-initial-mark: 284757K(1302528K)] 1320877K(2961408K), 0.7720557 secs] [Times: user=0.78 sys=0.01, real=0.77 secs] 
152442.492: [CMS-concurrent-mark-start]


推荐答案

CMS的评论必须扫描年轻一代,因为你的年轻一代如此庞大这需要一些时间。根据java版本(您没有指定!),您可能必须启用并行重新标记( CMSParallelRemarkEnabled )。

CMS remark has to scan the young generation, since your young generation is so large this takes some time. Depending on the java version (which you did not specify!) you may have to enable parallel remarking (CMSParallelRemarkEnabled).

启用 CMSScavengeBeforeRemark 也可能会减少备注期间需要扫描的内存量。

Enabling CMSScavengeBeforeRemark may also reduce the amount of memory that needs to be scanned during remarks.

只需缩小新一代产品,再加上一些促销活动,然后由旧的并发GC进行清理也可能发挥作用。

And simply shrinking the new generation and taking the hit of a few more promotions that then get cleaned out by the concurrent old gen GC may work too.

我不认为增量模式修复这里的任何内容都会大大改变CMS的行为,它会掩盖您的原始问题。

I don't think incremental mode fixes anything here, it just drastically alters the behavior of CMS that it masks your original issue.

这篇关于即使旧版本不满一半,CMS标记备注的高数量也会暂停的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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