怎么看我当前运行的是哪个垃圾收集器
1 -XX:+UseSerialGC serial/serial old
0.222: [Full GC (System.gc()) 0.222: [Tenured: 0K->16898K(102400K), 0.0164019 secs] 21299K->16898K(194560K), [Metaspace: 2458K->2458K(1056768K)], 0.0165361 secs] [Times: user=0.00 sys=0.02, real=0.02 secs] Heap def new generation total 92160K, used 2458K [0x00000000f3800000, 0x00000000f9c00000, 0x00000000f9c00000) eden space 81920K, 3% used [0x00000000f3800000, 0x00000000f3a66840, 0x00000000f8800000) from space 10240K, 0% used [0x00000000f8800000, 0x00000000f8800000, 0x00000000f9200000) to space 10240K, 0% used [0x00000000f9200000, 0x00000000f9200000, 0x00000000f9c00000) tenured generation total 102400K, used 16898K [0x00000000f9c00000, 0x0000000100000000, 0x0000000100000000) the space 102400K, 16% used [0x00000000f9c00000, 0x00000000fac80b60, 0x00000000fac80c00, 0x0000000100000000) Metaspace used 2467K, capacity 4486K, committed 4864K, reserved 1056768K class space used 272K, capacity 386K, committed 512K, reserved 1048576K |
2 -XX:+UseParNewGC parNew/serial old
0.148: [Full GC (System.gc()) 0.148: [Tenured: 0K->16898K(102400K), 0.0235919 secs] 21299K->16898K(194560K), [Metaspace: 2458K->2458K(1056768K)], 0.0237012 secs] [Times: user=0.00 sys=0.02, real=0.02 secs] Heap par new generation total 92160K, used 2458K [0x00000000f3800000, 0x00000000f9c00000, 0x00000000f9c00000) eden space 81920K, 3% used [0x00000000f3800000, 0x00000000f3a66840, 0x00000000f8800000) from space 10240K, 0% used [0x00000000f8800000, 0x00000000f8800000, 0x00000000f9200000) to space 10240K, 0% used [0x00000000f9200000, 0x00000000f9200000, 0x00000000f9c00000) tenured generation total 102400K, used 16898K [0x00000000f9c00000, 0x0000000100000000, 0x0000000100000000) the space 102400K, 16% used [0x00000000f9c00000, 0x00000000fac80b60, 0x00000000fac80c00, 0x0000000100000000) Metaspace used 2467K, capacity 4486K, committed 4864K, reserved 1056768K class space used 272K, capacity 386K, committed 512K, reserved 1048576K Java HotSpot(TM) 64-Bit Server VM warning: Using the ParNew young collector with the Serial old collector is deprecated and will likely be removed in a future release |
3 -XX:+UseConcMarkSweepGC parNew/CMS
0.195: [Full GC (System.gc()) 0.195: [CMS: 0K->16902K(102400K), 0.0305387 secs] 19661K->16902K(194560K), [Metaspace: 2455K->2455K(1056768K)], 0.0306686 secs] [Times: user=0.00 sys=0.02, real=0.03 secs] Heap par new generation total 92160K, used 2458K [0x00000000f3800000, 0x00000000f9c00000, 0x00000000f9c00000) eden space 81920K, 3% used [0x00000000f3800000, 0x00000000f3a66840, 0x00000000f8800000) from space 10240K, 0% used [0x00000000f8800000, 0x00000000f8800000, 0x00000000f9200000) to space 10240K, 0% used [0x00000000f9200000, 0x00000000f9200000, 0x00000000f9c00000) concurrent mark-sweep generation total 102400K, used 16902K [0x00000000f9c00000, 0x0000000100000000, 0x0000000100000000) Metaspace used 2464K, capacity 4486K, committed 4864K, reserved 1056768K class space used 272K, capacity 386K, committed 512K, reserved 1048576K |
4 -XX:+UseParallelGC parallel Scavenge/parallel old
0.140: [GC (System.gc()) [PSYoungGen: 20992K->8792K(89600K)] 20992K->16992K(192000K), 0.0468877 secs] [Times: user=0.06 sys=0.00, real=0.05 secs] 0.187: [Full GC (System.gc()) [PSYoungGen: 8792K->0K(89600K)] [ParOldGen: 8200K->16898K(102400K)] 16992K->16898K(192000K), [Metaspace: 2458K->2458K(1056768K)], 0.0420516 secs] [Times: user=0.05 sys=0.03, real=0.05 secs] Heap PSYoungGen total 89600K, used 2304K [0x00000000f9c00000, 0x0000000100000000, 0x0000000100000000) eden space 76800K, 3% used [0x00000000f9c00000,0x00000000f9e401e0,0x00000000fe700000) from space 12800K, 0% used [0x00000000fe700000,0x00000000fe700000,0x00000000ff380000) to space 12800K, 0% used [0x00000000ff380000,0x00000000ff380000,0x0000000100000000) ParOldGen total 102400K, used 16898K [0x00000000f3800000, 0x00000000f9c00000, 0x00000000f9c00000) object space 102400K, 16% used [0x00000000f3800000,0x00000000f4880b60,0x00000000f9c00000) Metaspace used 2467K, capacity 4486K, committed 4864K, reserved 1056768K class space used 272K, capacity 386K, committed 512K, reserved 1048576K |
5 -XX:+UseParallelOldGC parallel Scavenge/parallel old
0.155: [GC (System.gc()) [PSYoungGen: 19456K->8792K(89600K)] 19456K->16992K(192000K), 0.0239985 secs] [Times: user=0.06 sys=0.03, real=0.03 secs] 0.179: [Full GC (System.gc()) [PSYoungGen: 8792K->0K(89600K)] [ParOldGen: 8200K->16898K(102400K)] 16992K->16898K(192000K), [Metaspace: 2455K->2455K(1056768K)], 0.0147495 secs] [Times: user=0.02 sys=0.02, real=0.02 secs] Heap PSYoungGen total 89600K, used 2304K [0x00000000f9c00000, 0x0000000100000000, 0x0000000100000000) eden space 76800K, 3% used [0x00000000f9c00000,0x00000000f9e401e0,0x00000000fe700000) from space 12800K, 0% used [0x00000000fe700000,0x00000000fe700000,0x00000000ff380000) to space 12800K, 0% used [0x00000000ff380000,0x00000000ff380000,0x0000000100000000) ParOldGen total 102400K, used 16898K [0x00000000f3800000, 0x00000000f9c00000, 0x00000000f9c00000) object space 102400K, 16% used [0x00000000f3800000,0x00000000f4880b30,0x00000000f9c00000) Metaspace used 2464K, capacity 4486K, committed 4864K, reserved 1056768K class space used 272K, capacity 386K, committed 512K, reserved 1048576K |
6 -XX:+UseG1GC
0.172: [Full GC (System.gc()) 17M->16M(200M), 0.0110886 secs] [Eden: 2048.0K(100.0M)->0.0B(100.0M) Survivors: 0.0B->0.0B Heap: 17.5M(200.0M)->16.5M(200.0M)], [Metaspace: 2456K->2456K(1056768K)] [Times: user=0.00 sys=0.02, real=0.01 secs] Heap garbage-first heap total 204800K, used 16899K [0x00000000f3800000, 0x0000000100000000, 0x0000000100000000) region size 1024K, 1 young (1024K), 0 survivors (0K) Metaspace used 2465K, capacity 4486K, committed 4864K, reserved 1056768K class space used 272K, capacity 386K, committed 512K, reserved 1048576K |