我在使用Concurrent Mark-Sweep收集器的应用程序的GC日志文件中看到以下症状:
4031.248: [CMS-concurrent-preclean-start] 4031.250: [CMS-concurrent-preclean: 0.002/0.002 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 4031.250: [CMS-concurrent-abortable-preclean-start] CMS: abort preclean due to time 4036.346: [CMS-concurrent-abortable-preclean: 0.159/5.096 secs] [Times: user=0.00 sys=0.01, real=5.09 secs] 4036.346: [GC[YG occupancy: 55964 K (118016 K)]4036.347: [Rescan (parallel) , 0.0641200 secs]4036.411: [weak refs processing, 0.0001300 secs]4036.411: [class unloading, 0.0041590 secs]4036.415: [scrub symbol & string tables, 0.0053220 secs] [1 CMS-remark: 16015K(393216K)] 71979K(511232K), 0.0746640 secs] [Times: user=0.08 sys=0.00, real=0.08 secs]
预清洁过程不断中止.我已经尝试将CMSMaxAbortablePrecleanTime从默认值5调整为15秒,但这没有帮助.当前的JVM选项如下......
Djava.awt.headless=true -Xms512m -Xmx512m -Xmn128m -XX:MaxPermSize=128m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:BiasedLockingStartupDelay=0 -XX:+DoEscapeAnalysis -XX:+UseBiasedLocking -XX:+EliminateLocks -XX:+CMSParallelRemarkEnabled -verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -Xloggc:gc.log -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenPrecleaningEnabled -XX:CMSInitiatingOccupancyFraction=50 -XX:ReservedCodeCacheSize=64m -Dnetworkaddress.cache.ttl=30 -Xss128k
似乎并发 - 流产 - 预清洁永远不会有机会跑.我通过https://blogs.oracle.com/jonthecollector/entry/did_you_know阅读了有关启用CMSScavengeBeforeRemark的建议,但暂停的副作用似乎并不理想.任何人都可以提出任何建议吗?
此外,我想知道是否有人有一个很好的参考grokking CMS GC日志,特别是这一行:
[1 CMS-remark: 16015K(393216K)] 71979K(511232K), 0.0746640 secs]
不清楚这些数字所指的内存区域. 编辑 找到了这个http://www.sun.com/bigadmin/content/submitted/cms_gc_logs.jsp的链接