我正在试图理解的原因,大量的CMS标记和备注(以及其他阶段),平均约700毫秒,即使旧的一代甚至不到一半的full.Following是GC配置和统计来自GCViewer。
-Xms3g
-Xmx3g
-XX:NewSize=1800m
-XX:MaxNewSize=1800m
-XX:MaxPermSize=256m
-XX:SurvivorRatio=8
-XX:+UseConcMarkSweepGC
-XX:+CMSClassUnloadingEnabled使用GC查看器的摘要: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]发布于 2015-09-03 06:31:26
CMS评论必须扫描年轻一代,因为你的年轻一代是如此大,这需要一些时间。取决于java版本(您没有指定!)您可能需要启用并行复述(CMSParallelRemarkEnabled)。
启用CMSScavengeBeforeRemark还可以减少在备注期间需要扫描的内存量。
而简单地缩小新一代,并受到更多的促销活动的打击,然后被同步的老一代GC清理掉,也可能会奏效。
我不认为增量模式在这里修复任何东西,它只是彻底改变了CMS的行为,它掩盖了你最初的问题。
https://stackoverflow.com/questions/32302679
复制相似问题