每一种GC日志有区别,但是大同小异
33.125: [GC [PSYoungGen: 3937K->904K(76288K)] 3937K->912K(251392K), 0.0009287 secs] [Times: user=0.00 sys=0.00, real=0.00 secs]
100.667: [Full GC (System.gc()) [PSYoungGen: 904K->0K(76288K)] [ParOldGen: 8K->690K(175104K)] 912K->690K(251392K), [Metaspace: 3304K->3304K(1056768K)], 0.0042467 secs] [Times: user=0.14 sys=0.00, real=0.01 secs]
Heap
PSYoungGen total 76288K, used 1966K [0x000000076af00000, 0x0000000770400000, 0x00000007c0000000)
eden space 65536K, 3% used [0x000000076af00000,0x000000076b0eba90,0x000000076ef00000)
from space 10752K, 0% used [0x000000076ef00000,0x000000076ef00000,0x000000076f980000)
to space 10752K, 0% used [0x000000076f980000,0x000000076f980000,0x0000000770400000)
ParOldGen total 175104K, used 690K [0x00000006c0c00000, 0x00000006cb700000, 0x000000076af00000)
object space 175104K, 0% used [0x00000006c0c00000,0x00000006c0caca28,0x00000006cb700000)
Metaspace used 3335K, capacity 4496K, committed 4864K, reserved 1056768K
class space used 363K, capacity 388K, committed 512K, reserved 1048576K
-
33.125
或100.667
代表Java虚拟机启动以来经过的秒数 -
[Gc
或[Full GC
代表停顿类型,如果有Full说明GC发生了Stop-the-World
-
(System.gc())
是因为调用了System.gc()
方法所触发的收集,那么就会显示[GC System.gc()
-
PSYoungGen
表示GC所发生的区域,显示的区域名词和GC收集器有关系。- Serial新生代意思是
Default New Generation
所以显示[DefNew
- ParNew新生代意思是:
Parallel New Generation
就会变成[ParNew
- Parallel Scavenge 就会变成
[PSYoungGen
- 注:老年代
[Tenured
和永久代[Perm
同理,名称也是由收集器决定的
- Serial新生代意思是
-
PSYoungGen
后面的3937K->904K(76288K)
- 含义:GC前内存区域已使用容量 -> GC后该内存已使用容量(该内存区域总容量)
-
方括号之外的
3937K->912K(251392K)
- 含义:GC前Java堆已使用容量 -> GC后Java堆已使用容量(Java堆总容量)
-
后面的
0.0009287 secs
就是表示该内存区域GC所占用的时间,单位秒 -
[Times: user=0.00 sys=0.00, real=0.00 secs]
具体的时间数据,和Linux的time命令含义一致。- user:代表用户态消耗的CPU时间
- sys:内核态消耗的CPU时间
- real:操作从开始到结束所经过的墙钟时间(Wall Clock Time)
- CPU和墙钟时间区别就是:墙钟时间包括各种非运算的等待耗时,例等待磁盘I/O、等待线程阻塞。而CPU不包括这些耗时。同时如果看到user和sys超过read的时间,是正常的,因为多线程下,会把user sys的时间进行叠加。
-
Heap 系统运行完成前的快照,其他的字面意思了
- PSYoungGen 新生代
- ParOldGen 老年代
- Metaspace永久代