性能问答>每次启动服务为什么都会有两次间隔时间很短的 CMS并发GC?>
3回复
2年前

每次启动服务为什么都会有两次间隔时间很短的 CMS并发GC?



服务,每次重启之后的短时间内都会有两次 full gc, 我看 old 区并不满足 full gc 的条件(本来服务刚起来也不应该满足). 可能的原因是什么?

机器的配置是8核8G

配置如下:

VM_PARAM='-server -Xmx5g -Xms5g -XX:SurvivorRatio=8 -Xmn2000m -XX:PermSize=128m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -XX:+DisableExplicitGC -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintCommandLineFlags -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:ParallelCMSThreads=4 -XX:+CMSClassUnloadingEnabled -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=1 -XX:CMSInitiatingOccupancyFraction=72'

CMS 日志,第一次, 注意到 Initial 展示的已使用明明很小:

55.215: [GC [1 CMS-initial-mark: 257293K(3194880K)] 373536K(5038080K), 0.0145750 secs] [Times: user=0.02 sys=0.01, real=0.02 secs]55.230: [CMS-concurrent-mark-start]55.307: [CMS-concurrent-mark: 0.041/0.077 secs] [Times: user=0.19 sys=0.00, real=0.08 secs]55.307: [CMS-concurrent-preclean-start]55.314: [CMS-concurrent-preclean: 0.007/0.007 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]55.314: [CMS-concurrent-abortable-preclean-start]57.469: [CMS-concurrent-abortable-preclean: 1.892/2.155 secs] [Times: user=4.60 sys=0.47, real=2.16 secs]57.469: [GC[YG occupancy: 947351 K (1843200 K)]57.469: [Rescan (parallel) , 0.0274140 secs]57.497: [weak refs processing, 0.0007520 secs]57.498: [class unloading, 0.0073820 secs]57.505: [scrub symbol table, 0.0225440 secs]57.528: [scrub string table, 0.0008900 secs] [1 CMS-remark: 257293K(3194880K)] 1204645K(5038080K), 0.0602800 secs] [Times: user=0.14 sys=0.01, real=0.06 secs]57.530: [CMS-concurrent-sweep-start]57.638: [CMS-concurrent-sweep: 0.102/0.108 secs] [Times: user=0.20 sys=0.01, real=0.11 secs]57.638: [CMS-concurrent-reset-start]57.653: [CMS-concurrent-reset: 0.015/0.015 secs] [Times: user=0.01 sys=0.02, real=0.01 secs]

第二次:

101.074: [GC [1 CMS-initial-mark: 210923K(3194880K)] 1840102K(5038080K), 0.7751030 secs] [Times: user=0.79 sys=0.00, real=0.77 secs]101.856: [CMS-concurrent-mark-start]102.784: [CMS-concurrent-mark: 0.308/0.928 secs] [Times: user=1.89 sys=0.14, real=0.93 secs]102.785: [CMS-concurrent-preclean-start]102.869: [CMS-concurrent-preclean: 0.038/0.084 secs] [Times: user=0.12 sys=0.04, real=0.08 secs]102.869: [CMS-concurrent-abortable-preclean-start] CMS: abort preclean due to time 108.947: [CMS-concurrent-abortable-preclean: 6.012/6.078 secs] [Times: user=7.16 sys=0.15, real=6.08 secs]108.948: [GC[YG occupancy: 1786630 K (1843200 K)]108.948: [Rescan (parallel) , 0.7789900 secs]109.727: [weak refs processing, 0.0000360 secs]109.727: [class unloading, 0.0094410 secs]109.737: [scrub symbol table, 0.0482810 secs]109.785: [scrub string table, 0.0016560 secs] [1 CMS-remark: 210923K(3194880K)] 1997553K(5038080K), 0.8404400 secs] [Times: user=3.08 sys=0.01, real=0.84 secs]109.789: [CMS-concurrent-sweep-start]109.937: [CMS-concurrent-sweep: 0.147/0.147 secs] [Times: user=0.19 sys=0.00, real=0.15 secs]109.937: [CMS-concurrent-reset-start]109.945: [CMS-concurrent-reset: 0.008/0.008 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
2988 阅读
请先登录,查看3条精彩评论吧
快去登录吧,你将获得
  • 浏览更多精彩评论
  • 和开发者讨论交流,共同进步