GC之CMS GC日志分析

本文探讨了JVM中的CMS垃圾收集器,通过分析实际的CMS GC日志,解析各个要素,深入理解其工作原理和优化关键点。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

       最近在学习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] 15887.463: [CMS-concurrent-abortable-preclean-start]15888.433: [CMS-concurrent-abortable-preclean: 0.880/0.970 secs] [Times: user=3.00 sys=0.60, real=0.97 secs]

[GC (CMS Final Remark) [YG occupancy: 380362 K (629120 K)]15888.435: [Rescan (parallel) ,
0.1452201 secs]15888.580: [weak refs processing, 0.0015400 secs]
15888.582: [class unloading, 0.0541155 secs]
15888.636: [scrub symbol table, 0.0049675 secs]
15888.641: [scrub string table, 0.0009185 secs][1 CMS-remark: 1307523K(1398144K)]
1687886K(2027264K), 0.2161993 secs] [Times: user=0.62 sys=0.01, real=0.22 secs]
15888.651: [CMS-concurrent-sweep-start]15889.816: [CMS-concurrent-sweep: 0.947/1.165 secs] [Times: user=3.74 sys=0.68, real=1.17 secs] 15889.816: [CMS-concurrent-reset-start]15889.838: [CMS-concurrent-reset: 0.022/0.022 secs] [Times: user=0.07 sys=0.02, real=0.02 secs]



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值