G1日志详解分析 GC基础算法 YGC 日志 超详细

本文详细分析了G1垃圾收集器的YGC、Concurrent Marking Cycle、MixedGC和FullGC日志,包括各阶段的时间消耗、线程活动、内存分配和回收情况,有助于理解G1 GC的工作机制和性能优化。
摘要由CSDN通过智能技术生成

GC基础算法

YGC 日志

2021-09-13T23:47:13.059+0800: 8306957.465: [GC pause (G1 Evacuation Pause) (young)2021-09-13T23:47:13.068+0800: 8306957.474: [SoftReference, 0
refs, 0.0000453 secs]2021-09-13T23:47:13.068+0800: 8306957.474: [WeakReference, 2 refs, 0.0000063 secs]2021-09-13T23:47:13.068+0800: 8306957.47
4: [FinalReference, 8 refs, 0.0000095 secs]2021-09-13T23:47:13.068+0800: 8306957.474: [PhantomReference, 0 refs, 1 refs, 0.0000286 secs]2021-09
-13T23:47:13.068+0800: 8306957.474: [JNI Weak Reference, 0.0000140 secs], 0.0102679 secs]
   [Parallel Time: 8.0 ms, GC Workers: 16]
      [GC Worker Start (ms): Min: 8306957465.7, Avg: 8306957465.7, Max: 8306957465.8, Diff: 0.1]
      [Ext Root Scanning (ms): Min: 0.5, Avg: 0.6, Max: 2.0, Diff: 1.6, Sum: 10.1]
      [Update RS (ms): Min: 4.3, Avg: 5.9, Max: 6.2, Diff: 1.9, Sum: 94.4]
         [Processed Buffers: Min: 27, Avg: 31.4, Max: 41, Diff: 14, Sum: 502]
      [Scan RS (ms): Min: 0.0, Avg: 0.1, Max: 0.2, Diff: 0.2, Sum: 1.9]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
      [Object Copy (ms): Min: 1.0, Avg: 1.0, Max: 1.1, Diff: 0.1, Sum: 16.4]
      [Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.3]
         [Termination Attempts: Min: 1, Avg: 1.2, Max: 2, Diff: 1, Sum: 20]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.1, Max: 0.1, Diff: 0.1, Sum: 1.0]
      [GC Worker Total (ms): Min: 7.7, Avg: 7.8, Max: 7.9, Diff: 0.2, Sum: 124.2]
      [GC Worker End (ms): Min: 8306957473.4, Avg: 8306957473.5, Max: 8306957473.5, Diff: 0.1]
   [Code Root Fixup: 0.0 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 0.4 ms]
   [Other: 1.9 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 0.4 ms]
      [Ref Enq: 0.0 ms]
      [Redirty Cards: 0.2 ms]
      [Humongous Register: 0.1 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 1.0 ms]
   [Eden: 2102.0M(2102.0M)->0.0B(2102.0M) Survivors: 8192.0K->8192.0K Heap: 4054.7M(4520.0M)->1953.1M(4520.0M)]
 [Times: user=0.13 sys=0.00, real=0.01 secs]
2021-09-13T23:47:13.070+0800: 8306957.476: Total time for which application threads were stopped: 0.0147420 seconds, Stopping threads took: 0.0
001054 seconds
  • 2021-09-13T23:47:13.059+0800: 8306957.465: [GC pause (G1 Evacuation Pause) (young) .... 0.0102679 secs]。 (G1 Evacuation Pause) (young)标志是YGC,耗时是 10.2ms。2021-09-13T23:47:13.059 是时间,+800是东八区,8306957.465 是JVM启动后的相对时间(秒)。
  • [Parallel Time: 8.0 ms, GC Workers: 16] 表示 并行收集任务,有16 个GC线程,从新生代垃圾收集开始到最后一个任务结束(wall clock time)总共用时 8ms。STW过程。
    • [GC Worker Start (ms) Min: 8306957465.7, Avg: 8306957465.7, Max: 8306957465.8, Diff: 0.1]:min指的是 第一个垃圾收集线程开始工作时JVM启动后经过的时间,max指的是最后一个,diff表示min和max之间的差值。理想情况下,你希望他们几乎是同时开始,即diff趋近于0。
    • [Ext Root Scanning (ms): Min: 0.5, Avg: 0.6, Max: 2.0, Diff: 1.6, Sum: 10.1]: 扫描root集合(线程栈、JNI、全局变量、系统表等等),尝试找到是否有root集合中的节点指向当前的收集集合(CSet)。Sum表示所有线程花费的total cpu time&#x
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值