jvm 打印log
选项 | 作用 |
---|---|
-verbose:gc | 输出简要GC日志 |
-XX:+PrintGCDetails | 输出详细GC日志 |
-XX:+PrintGCDateStamps | 输出GC的时间戳(以日期的形式,如 2013-05-04T21:53:59.234+0800) |
-XX:+PrintReferenceGC | 打印年轻代各个引用的数量以及时长 |
-Xloggc:/data/tmp/gc.log | 输出GC日志到文件 |
在JDK 8中,-verbose:gc是-XX:+PrintGC一个别称,日志格式等价与:-XX:+PrintGC,。
不过在JDK 9中 -XX:+PrintGC被标记为deprecated。
-verbose:gc是一个标准的选项, -XX:+PrintGC是一个实验的选项,建议使用-verbose:gc替代-XX:+PrintGC
-verbose:gc
2021-06-28T14:20:42.670+0800: 170747.908: [GC pause (G1 Evacuation Pause) (young), 0.0126968 secs]
-XX:+PrintGCDateStamps
[Parallel Time: 12.0 ms, GC Workers: 8]
[GC Worker Start (ms): Min: 170747908.4, Avg: 170747908.5, Max: 170747908.7, Diff: 0.3]
[Ext Root Scanning (ms): Min: 0.2, Avg: 0.3, Max: 0.4, Diff: 0.3, Sum: 2.7]
[Update RS (ms): Min: 3.1, Avg: 3.1, Max: 3.1, Diff: 0.1, Sum: 24.7]
[Processed Buffers: Min: 10, Avg: 14.5, Max: 28, Diff: 18, Sum: 116]
[Scan RS (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
[Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
[Object Copy (ms): Min: 8.3, Avg: 8.3, Max: 8.3, Diff: 0.0, Sum: 66.3]
[Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
[Termination Attempts: Min: 1, Avg: 40.1, Max: 59, Diff: 58, Sum: 321]
[GC Worker Other (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.1]
[GC Worker Total (ms): Min: 11.6, Avg: 11.7, Max: 11.8, Diff: 0.2, Sum: 94.0]
[GC Worker End (ms): Min: 170747920.3, Avg: 170747920.3, Max: 170747920.3, Diff: 0.0]
[Code Root Fixup: 0.1 ms]
[Code Root Purge: 0.0 ms]
[Clear CT: 0.1 ms]
[Other: 0.5 ms]
[Choose CSet: 0.0 ms]
[Ref Proc: 0.2 ms]
[Ref Enq: 0.0 ms]
[Redirty Cards: 0.1 ms]
[Humongous Register: 0.0 ms]
[Humongous Reclaim: 0.0 ms]
[Free CSet: 0.1 ms]
[Eden: 292.0M(292.0M)->0.0B(268.0M) Survivors: 8192.0K->24.0M Heap: 381.8M(504.0M)->103.7M(504.0M)]
-XX:+PrintGCDateStamps
[Times: user=0.10 sys=0.00, real=0.01 secs]