最近在学习JVM和GC调优,今天总结下CMS的一些特点和要点,首先贴上一个实际的CMS GC log,先来解读下各个元素。
/* 从下面的GC日志可以看出,当前最新版本(JDK1.8)中的CMS大致分为6步 1. CMS Initial Mark 初始标记 2. CMS-concurrent-mark 并发标记 3. CMS-concurrent-preclean 预处理
4. CMS-concurrent-abortable-preclean 预处理 5.
*/
//初始标记 这个动作需要stop the world
//这个步骤仅仅是标记一下GC Roots能直接关联到的对象
15887.169: [GC (CMS Initial Mark) [1 CMS-initial-mark: 1307523K(1398144K)]
1336024K(2027264K), 0.0046835 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 15887.173: [CMS-concurrent-mark-start]15887.443: [CMS-concurrent-mark: 0.269/0.269 secs] [Times: user=0.90 sys=0.16, real=0.27 secs] 15887.443: [CMS-concurrent-preclean-start]15887.462: [CMS-concurrent-preclean: 0.019/0.020 secs] [Times: user=0.06 sys=0.02, real=0.02 secs]