CMSInitiatingOccupancyFraction = N可以在增量模式下与CMS一起使用吗?

时间:2011-07-28 15:32:14

标签: java content-management-system jvm

我们遇到了在JDK 1.5 update 11上运行CMS收集器的几个并发模式失败的问题。我尝试过关注Sun指南http://www.oracle.com/technetwork/java/gc-tuning-5-138395.html以及此处和其他博客的其他提示。我们目前正在运行:

-Xms1792m -Xmx1792m -XX:NewSize=512m -XX:MaxNewSize=512m -XX:PermSize=384m -XX:MaxPermSize=384m -Xss128k -XX:+DisableExplicitGC -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+CMSIncrementalMode -XX:-CMSIncrementalPacing -XX:CMSIncrementalDutyCycle=30 -XX:CMSIncrementalSafetyFactor=30 -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled -verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:-TraceClassUnloading -server 

服务器通常可以使用2-3天,在一天中我只能看到1或2个并发模式故障,但之后我开始看到故障显着增加。我们正在调查缓慢内存泄漏的可能性,但同时停顿变得越来越糟糕,有时每20分钟需要重启20秒(然后再开2-3天就好了)

我们在2 Core,4 GB机器上运行,因此启用了增量模式,因为没有cpu峰值导致性能问题。

所以,我的问题是,为了让CMS尽早开始尝试避免失败,我想指定CMSInitiatingOccupancyFraction = 50(开头)。但是,当CMS收集器处于增量模式时,我无法找到-XX:CMSInitiatingOccupancyFraction = N标志的明确答案。

如果这些2不能一起使用,我可以采取哪些其他措施来减少并发模式故障的数量?我们不能将堆大小增加到现在的水平以上,我已经尝试将安全系数提高到30并将占空比提高到30 - 我应该尝试将它们提高一些吗?

e.g。日志:

363419.049: [CMS-concurrent-sweep-start]
363420.908: [GC 363420.909: [ParNew: 523392K->0K(523840K), 0.0795650 secs] 1652124K->1136058K(1834560K), 0.0803380 secs]
363429.886: [GC 363429.887: [ParNew: 523392K->0K(523840K), 0.0706960 secs] 1659196K->1144335K(1834560K), 0.0714890 secs]
363432.566: [Full GC 363432.566: [ParNew: 520584K->0K(523840K), 0.0769280 secs] 1672290K->1169919K(1834560K), 0.0775740 secs]
363439.937: [Full GC 363439.938: [ParNew (promotion failed): 523840K->523840K(523840K), 0.3404490 secs] 1690606K->1712399K(1834560K), 0.3412880 secs]
363440.280: [GC 363440.280: [ParNew (promotion failed): 523840K->523840K(523840K), 0.2211610 secs]363440.502: [CMS363440.935: [CMS-concurrent-sweep: 4.549/21.886 secs]
 (concurrent mode failure): 1188559K->1047404K(1310720K), 9.2920010 secs] 1712399K->1047404K(1834560K), 9.5137760 secs]
363451.421: [GC [1 CMS-initial-mark: 1047404K(1310720K)] 1245963K(1834560K), 0.1440540 secs]
363453.521: [CMS-concurrent-mark-start]
363453.523: [GC 363453.523: [ParNew: 523840K->0K(523840K), 0.1876280 secs] 1576618K->1175643K(1834560K), 0.1879520 secs]
363458.913: [GC 363458.913: [ParNew: 523097K->0K(523840K), 0.0639300 secs] 1698741K->1181843K(1834560K), 0.0644500 secs]
363468.068: [GC 363468.068: [ParNew: 523392K->0K(523840K), 0.0758130 secs] 1705235K->1187900K(1834560K), 0.0763340 secs]
363472.286: [CMS-concurrent-mark: 6.721/18.765 secs]
363472.286: [CMS-concurrent-preclean-start]
363472.493: [CMS-concurrent-preclean: 0.182/0.207 secs]
363472.493: [CMS-concurrent-abortable-preclean-start]
363476.433: [GC 363476.433: [ParNew: 523392K->0K(523840K), 0.0798890 secs] 1711292K->1193725K(1834560K), 0.0804050 secs]
363485.438: [CMS-concurrent-abortable-preclean: 0.598/12.945 secs]
363485.440: [GC[YG occupancy: 268431 K (523840 K)]363485.441: [Rescan (parallel) , 0.3050930 secs]363485.746: [weak refs processing, 0.0183180 secs] [1 CMS-remark: 1193725K(1310720K)] 1462157K(1834560K), 0.3241100 secs]
363485.772: [CMS-concurrent-sweep-start]
363486.619: [CMS-concurrent-sweep: 0.847/0.847 secs]
363486.620: [CMS-concurrent-reset-start]
363486.665: [CMS-concurrent-reset: 0.046/0.046 secs]
363487.664: [GC 363487.664: [ParNew: 523392K->0K(523840K), 0.0714820 secs] 1633423K->1117613K(1834560K), 0.0718980 secs]
363489.713: [GC [1 CMS-initial-mark: 1117613K(1310720K)] 1301530K(1834560K), 0.2237580 secs]
363489.937: [CMS-concurrent-mark-start]
363495.025: [GC 363495.025: [ParNew: 523392K->0K(523840K), 0.0726450 secs] 1641005K->1125508K(1834560K), 0.0730750 secs]
363501.032: [GC 363501.032: [ParNew: 523392K->0K(523840K), 0.0828310 secs] 1648900K->1135299K(1834560K), 0.0833360 secs]
363506.197: [GC 363506.198: [ParNew: 523392K->0K(523840K), 0.0711940 secs] 1658691K->1141905K(1834560K), 0.0716800 secs]
363510.793: [GC 363510.793: [ParNew: 523392K->0K(523840K), 0.0986860 secs] 1665297K->1150247K(1834560K), 0.0992440 secs]
363514.765: [GC 363514.765: [ParNew: 523840K->0K(523840K), 0.2155430 secs] 1690628K->1263649K(1834560K), 0.2159440 secs]
363519.207: [CMS-concurrent-mark: 7.769/29.270 secs]
363519.207: [CMS-concurrent-preclean-start]
363519.729: [CMS-concurrent-preclean: 0.454/0.523 secs]
363519.729: [CMS-concurrent-abortable-preclean-start]
363521.051: [GC 363521.051: [ParNew: 523392K->523392K(523840K), 0.0000180 secs]363521.052: [CMS363521.104: [CMS-concurrent-abortable-preclean: 0.120/1.374 secs]
 (concurrent mode failure): 1263649K->900173K(1310720K), 8.5664420 secs] 1787041K->900173K(1834560K), 8.5671060 secs]
363531.417: [GC [1 CMS-initial-mark: 900173K(1310720K)] 1084069K(1834560K), 0.2132160 secs]



363419.049: [CMS-concurrent-sweep-start]
363420.908: [GC 363420.909: [ParNew: 523392K->0K(523840K), 0.0795650 secs] 1652124K->1136058K(1834560K), 0.0803380 secs]
363429.886: [GC 363429.887: [ParNew: 523392K->0K(523840K), 0.0706960 secs] 1659196K->1144335K(1834560K), 0.0714890 secs]
363432.566: [Full GC 363432.566: [ParNew: 520584K->0K(523840K), 0.0769280 secs] 1672290K->1169919K(1834560K), 0.0775740 secs]
363439.937: [Full GC 363439.938: [ParNew (promotion failed): 523840K->523840K(523840K), 0.3404490 secs] 1690606K->1712399K(1834560K), 0.3412880 secs]
363440.280: [GC 363440.280: [ParNew (promotion failed): 523840K->523840K(523840K), 0.2211610 secs]363440.502: [CMS363440.935: [CMS-concurrent-sweep: 4.549/21.886 secs]
 (concurrent mode failure): 1188559K->1047404K(1310720K), 9.2920010 secs] 1712399K->1047404K(1834560K), 9.5137760 secs]
363451.421: [GC [1 CMS-initial-mark: 1047404K(1310720K)] 1245963K(1834560K), 0.1440540 secs]
363453.521: [CMS-concurrent-mark-start]
363453.523: [GC 363453.523: [ParNew: 523840K->0K(523840K), 0.1876280 secs] 1576618K->1175643K(1834560K), 0.1879520 secs]
363458.913: [GC 363458.913: [ParNew: 523097K->0K(523840K), 0.0639300 secs] 1698741K->1181843K(1834560K), 0.0644500 secs]
363468.068: [GC 363468.068: [ParNew: 523392K->0K(523840K), 0.0758130 secs] 1705235K->1187900K(1834560K), 0.0763340 secs]
363472.286: [CMS-concurrent-mark: 6.721/18.765 secs]
363472.286: [CMS-concurrent-preclean-start]
363472.493: [CMS-concurrent-preclean: 0.182/0.207 secs]
363472.493: [CMS-concurrent-abortable-preclean-start]
363476.433: [GC 363476.433: [ParNew: 523392K->0K(523840K), 0.0798890 secs] 1711292K->1193725K(1834560K), 0.0804050 secs]
363485.438: [CMS-concurrent-abortable-preclean: 0.598/12.945 secs]
363485.440: [GC[YG occupancy: 268431 K (523840 K)]363485.441: [Rescan (parallel) , 0.3050930 secs]363485.746: [weak refs processing, 0.0183180 secs] [1 CMS-remark: 1193725K(1310720K)] 1462157K(1834560K), 0.3241100 secs]
363485.772: [CMS-concurrent-sweep-start]
363486.619: [CMS-concurrent-sweep: 0.847/0.847 secs]
363486.620: [CMS-concurrent-reset-start]
363486.665: [CMS-concurrent-reset: 0.046/0.046 secs]
363487.664: [GC 363487.664: [ParNew: 523392K->0K(523840K), 0.0714820 secs] 1633423K->1117613K(1834560K), 0.0718980 secs]
363489.713: [GC [1 CMS-initial-mark: 1117613K(1310720K)] 1301530K(1834560K), 0.2237580 secs]
363489.937: [CMS-concurrent-mark-start]
363495.025: [GC 363495.025: [ParNew: 523392K->0K(523840K), 0.0726450 secs] 1641005K->1125508K(1834560K), 0.0730750 secs]
363501.032: [GC 363501.032: [ParNew: 523392K->0K(523840K), 0.0828310 secs] 1648900K->1135299K(1834560K), 0.0833360 secs]
363506.197: [GC 363506.198: [ParNew: 523392K->0K(523840K), 0.0711940 secs] 1658691K->1141905K(1834560K), 0.0716800 secs]
363510.793: [GC 363510.793: [ParNew: 523392K->0K(523840K), 0.0986860 secs] 1665297K->1150247K(1834560K), 0.0992440 secs]
363514.765: [GC 363514.765: [ParNew: 523840K->0K(523840K), 0.2155430 secs] 1690628K->1263649K(1834560K), 0.2159440 secs]
363519.207: [CMS-concurrent-mark: 7.769/29.270 secs]
363519.207: [CMS-concurrent-preclean-start]
363519.729: [CMS-concurrent-preclean: 0.454/0.523 secs]
363519.729: [CMS-concurrent-abortable-preclean-start]
363521.051: [GC 363521.051: [ParNew: 523392K->523392K(523840K), 0.0000180 secs]363521.052: [CMS363521.104: [CMS-concurrent-abortable-preclean: 0.120/1.374 secs]
 (concurrent mode failure): 1263649K->900173K(1310720K), 8.5664420 secs] 1787041K->900173K(1834560K), 8.5671060 secs]
363531.417: [GC [1 CMS-initial-mark: 900173K(1310720K)] 1084069K(1834560K), 0.2132160 secs]
363531.631: [CMS-concurrent-mark-start]

0 个答案:

没有答案