# JDK8
-Xms20M -Xmx20M -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC
CMS 日志格式:
[GC (Allocation Failure) [ParNew: 5504K->640K(6144K), 0.0136830 secs] 5504K->1556K(19840K), 0.0137738 secs] [Times: user=0.06 sys=0.01, real=0.01 secs]
[GC (Allocation Failure) [ParNew: 6144K->544K(6144K), 0.0012950 secs] 7060K->2102K(19840K), 0.0013310 secs] [Times: user=0.01 sys=0.00, real=0.00 secs]
[GC (Allocation Failure) [ParNew: 6048K->640K(6144K), 0.0175172 secs] 7606K->4311K(19840K), 0.0176172 secs] [Times: user=0.07 sys=0.01, real=0.01 secs]
[GC (Allocation Failure) [ParNew: 6144K->640K(6144K), 0.0163793 secs] 9815K->7694K(19840K), 0.0164765 secs] [Times: user=0.10 sys=0.01, real=0.01 secs]
# ParNew:年轻代收集器 6144->640:收集前后的对比 (6144):整个年轻代容量 9815 ->7694:整个堆的情况(19840):整个堆大小
[GC (CMS Initial Mark) [1 CMS-initial-mark: 7054K(13696K)] 7806K(19840K), 0.0023289 secs] [Times: user=0.00 sys=0.00, real=0.01 secs]
# 初始标记,STW, 7054K(13696K) 老年代使用空间、最大空间 7806K(19840K) 整个堆使用空间、最大空间
[CMS-concurrent-mark-start]
[CMS-concurrent-mark: 0.015/0.015 secs] [Times: user=0.05 sys=0.00, real=0.01 secs]
# 并发标记,这里的时间意义不大,因为是并发执行
[CMS-concurrent-preclean-start]
[CMS-concurrent-preclean: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
# //标记Card为Dirty,也称为Card Markin
[GC (CMS Final Remark) [YG occupancy: 1865 K (6144 K)][Rescan (parallel) , 0.0015431 secs][weak refs processing, 0.0000870 secs][class unloading, 0.0017562 secs][scrub symbol table, 0.0012416 secs][scrub string table, 0.0006834 secs][1 CMS-remark: 7054K(13696K)] 8919K(19840K), 0.0054720 secs] [Times: user=0.01 sys=0.01, real=0.01 secs]
# STW阶段,YG occupancy: 年轻代占用及容量
#[Rescan (parallel):STW下的存活对象标记
#weak refs processing: 弱引用处理
#class unloading: 卸载用不到的class
#scrub symbol(string) table: cleaning up symbol and string tables which hold class-level metadata and internalized string respectively
#CMS-remark: 7054K(13696K): 阶段过后的老年代占用及容量
# 8919K(19840K) : 阶段过后的堆占用及容量
[CMS-concurrent-sweep-start]
[CMS-concurrent-sweep: 0.010/0.010 secs] [Times: user=0.02 sys=0.00, real=0.01 secs]
# 标记已经完成,进行并发清理
[CMS-concurrent-reset-start]
[CMS-concurrent-reset: 0.000/0.000 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
# 重置内部结构,为下次GC做准备
by Sven Augustus https://my.oschina.net/langxSpirit
@SvenAugustus(https://www.flysium.xyz/)
更多请关注微信公众号【编程不离宗】,专注于分享服务器开发与编程相关的技术干货: