openjdk 21 GC功能测试结果汇总¶
测试环境
qemu-system-riscv64 --version
QEMU emulator version 8.1.92
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers
cat /etc/os-release
NAME="openEuler"
VERSION="24.03 (LTS)"
ID="openEuler"
VERSION_ID="24.03"
PRETTY_NAME="openEuler 24.03 (LTS)"
ANSI_COLOR="0;31"
java -version
openjdk version "21.0.2" 2024-01-16
OpenJDK Runtime Environment BiSheng (build 21.0.2+12)
OpenJDK 64-Bit Server VM BiSheng (build 21.0.2+12, mixed mode, sharing)
测试代码
[root@localhost jdk21]# cat binarytrees.java
/**
* The Computer Language Benchmarks Game
* https://salsa.debian.org/benchmarksgame-team/benchmarksgame/
*
* Loosely based on Jarkko Miettinen's implementation. Requires Java 8.
*
* contributed by Heikki Salokanto.
* modified by Chandra Sekar
* modified by Mike Krüger
* *reset*
*/
public class binarytrees {
public static void main(String[] args) throws Exception {
int n = args.length > 0 ? Integer.parseInt(args[0]) : 0;
int minDepth = 4;
int maxDepth = Math.max(minDepth + 2, n);
int stretchDepth = maxDepth + 1;
int check = (TreeNode.create(stretchDepth)).check();
System.out.println("stretch tree of depth " + (maxDepth + 1) + "\t check: " + check);
TreeNode longLivedTree = TreeNode.create(maxDepth);
for (int depth = minDepth; depth <= maxDepth; depth += 2)
{
int iterations = 1 << (maxDepth - depth + minDepth);
check = 0;
for (int i = 1; i <= iterations; i++)
{
check += (TreeNode.create(depth)).check();
}
System.out.println(iterations + "\t trees of depth " + depth + "\t check: " + check);
}
System.out.println("long lived tree of depth " + maxDepth + "\t check: " + longLivedTree.check());
}
static class TreeNode {
TreeNode left, right;
static TreeNode create(int depth)
{
return ChildTreeNodes(depth);
}
static TreeNode ChildTreeNodes(int depth)
{
TreeNode node = new TreeNode();
if (depth > 0)
{
node.left = ChildTreeNodes(depth - 1);
node.right = ChildTreeNodes(depth - 1);
}
return node;
}
int check() {
return left == null ? 1 : left.check() + right.check() + 1;
}
}
}
1.SerialGC test ok¶
[root@localhost jdk21]# java -XX:+UseSerialGC -XX:+PrintGCDetails -Xmx100m -Xms10m binarytrees 18
[0.016s][warning][gc] -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
[0.069s][info ][gc,init] CardTable entry size: 512
[0.070s][info ][gc ] Using Serial
[0.075s][info ][gc,init] Version: 21.0.2+12 (release)
[0.075s][info ][gc,init] CPUs: 4 total, 4 available
[0.076s][info ][gc,init] Memory: 7678M
[0.077s][info ][gc,init] Large Page Support: Disabled
[0.077s][info ][gc,init] NUMA Support: Disabled
[0.077s][info ][gc,init] Compressed Oops: Enabled (32-bit)
[0.077s][info ][gc,init] Heap Min Capacity: 10M
[0.077s][info ][gc,init] Heap Initial Capacity: 10M
[0.077s][info ][gc,init] Heap Max Capacity: 100M
[0.077s][info ][gc,init] Pre-touch: Disabled
[0.444s][info ][gc,metaspace] CDS archive(s) mapped at: [0x0000003f27000000-0x0000003f27ca8000-0x0000003f27ca8000), size 13271040, SharedBaseAddress: 0x0000003f27000000, ArchiveRelocationMode: 1.
[0.445s][info ][gc,metaspace] Compressed class space mapped at: 0x0000003f28000000-0x0000003f68000000, reserved size: 1073741824
[0.445s][info ][gc,metaspace] Narrow klass base: 0x0000003f27000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
[0.799s][info ][gc,start ] GC(0) Pause Young (Allocation Failure)
[0.866s][info ][gc,heap ] GC(0) DefNew: 2752K(3072K)->319K(3072K) Eden: 2752K(2752K)->0K(2752K) From: 0K(320K)->319K(320K)
[0.866s][info ][gc,heap ] GC(0) Tenured: 1053K(6848K)->3363K(6848K)
[0.866s][info ][gc,metaspace] GC(0) Metaspace: 70K(256K)->70K(256K) NonClass: 66K(128K)->66K(128K) Class: 3K(128K)->3K(128K)
[0.867s][info ][gc ] GC(0) Pause Young (Allocation Failure) 3M->3M(9M) 67.565ms
[0.867s][info ][gc,cpu ] GC(0) User=0.06s Sys=0.01s Real=0.07s
[0.878s][info ][gc,start ] GC(1) Pause Young (Allocation Failure)
[0.938s][info ][gc,heap ] GC(1) DefNew: 3071K(3072K)->319K(3072K) Eden: 2751K(2752K)->0K(2752K) From: 319K(320K)->319K(320K)
[0.938s][info ][gc,heap ] GC(1) Tenured: 3363K(6848K)->6111K(6848K)
[0.938s][info ][gc,metaspace] GC(1) Metaspace: 70K(256K)->70K(256K) NonClass: 66K(128K)->66K(128K) Class: 3K(128K)->3K(128K)
[0.939s][info ][gc ] GC(1) Pause Young (Allocation Failure) 6M->6M(9M) 60.690ms
[0.939s][info ][gc,cpu ] GC(1) User=0.05s Sys=0.00s Real=0.06s
[0.944s][info ][gc,start ] GC(2) Pause Young (Allocation Failure)
[1.031s][info ][gc ] GC(2) Pause Young (Allocation Failure) 8M->8M(11M) 86.500ms
[1.031s][info ][gc,cpu ] GC(2) User=0.06s Sys=0.03s Real=0.09s
[1.031s][info ][gc,start ] GC(3) Pause Full (Allocation Failure)
[1.031s][info ][gc,phases,start] GC(3) Phase 1: Mark live objects
[1.113s][info ][gc,phases ] GC(3) Phase 1: Mark live objects 81.805ms
[1.113s][info ][gc,phases,start] GC(3) Phase 2: Compute new object addresses
[1.154s][info ][gc,phases ] GC(3) Phase 2: Compute new object addresses 40.435ms
[1.154s][info ][gc,phases,start] GC(3) Phase 3: Adjust pointers
[1.184s][info ][gc,phases ] GC(3) Phase 3: Adjust pointers 30.157ms
[1.184s][info ][gc,phases,start] GC(3) Phase 4: Move objects
[1.188s][info ][gc,phases ] GC(3) Phase 4: Move objects 3.866ms
.......
[11.535s][info ][gc,heap ] GC(120) DefNew: 17344K(17344K)->0K(17536K) Eden: 15424K(15424K)->0K(15616K) From: 1920K(1920K)->0K(1920K)
[11.536s][info ][gc,heap ] GC(120) Tenured: 32168K(38456K)->23310K(38852K)
[11.536s][info ][gc,metaspace ] GC(120) Metaspace: 265K(448K)->265K(448K) NonClass: 248K(320K)->248K(320K) Class: 17K(128K)->17K(128K)
[11.536s][info ][gc ] GC(120) Pause Full (Allocation Failure) 40M->22M(55M) 556.777ms
[11.536s][info ][gc,cpu ] GC(120) User=0.50s Sys=0.06s Real=0.56s
[11.594s][info ][gc,start ] GC(121) Pause Young (Allocation Failure)
[11.668s][info ][gc,heap ] GC(121) DefNew: 15616K(17536K)->1920K(17536K) Eden: 15616K(15616K)->0K(15616K) From: 0K(1920K)->1920K(1920K)
[11.668s][info ][gc,heap ] GC(121) Tenured: 23310K(38852K)->24714K(38852K)
[11.668s][info ][gc,metaspace ] GC(121) Metaspace: 265K(448K)->265K(448K) NonClass: 248K(320K)->248K(320K) Class: 17K(128K)->17K(128K)
[11.668s][info ][gc ] GC(121) Pause Young (Allocation Failure) 38M->26M(55M) 74.405ms
[11.669s][info ][gc,cpu ] GC(121) User=0.06s Sys=0.02s Real=0.07s
[11.708s][info ][gc,start ] GC(122) Pause Young (Allocation Failure)
[11.797s][info ][gc,heap ] GC(122) DefNew: 17536K(17536K)->1920K(17536K) Eden: 15616K(15616K)->0K(15616K) From: 1920K(1920K)->1920K(1920K)
[11.797s][info ][gc,heap ] GC(122) Tenured: 24714K(38852K)->28421K(38852K)
[11.797s][info ][gc,metaspace ] GC(122) Metaspace: 265K(448K)->265K(448K) NonClass: 248K(320K)->248K(320K) Class: 17K(128K)->17K(128K)
[11.797s][info ][gc ] GC(122) Pause Young (Allocation Failure) 41M->29M(55M) 88.953ms
[11.797s][info ][gc,cpu ] GC(122) User=0.09s Sys=0.00s Real=0.09s
16 trees of depth 18 check: 8388592
long lived tree of depth 18 check: 524287
[11.888s][info ][gc,heap,exit ] Heap
[11.888s][info ][gc,heap,exit ] def new generation total 17536K, used 10663K [0x00000000f9c00000, 0x00000000faf00000, 0x00000000fbd50000)
[11.888s][info ][gc,heap,exit ] eden space 15616K, 55% used [0x00000000f9c00000, 0x00000000fa489cd0, 0x00000000fab40000)
[11.888s][info ][gc,heap,exit ] from space 1920K, 100% used [0x00000000fab40000, 0x00000000fad20000, 0x00000000fad20000)
[11.889s][info ][gc,heap,exit ] to space 1920K, 0% used [0x00000000fad20000, 0x00000000fad20000, 0x00000000faf00000)
[11.889s][info ][gc,heap,exit ] tenured generation total 38852K, used 28421K [0x00000000fbd50000, 0x00000000fe341000, 0x0000000100000000)
[11.889s][info ][gc,heap,exit ] the space 38852K, 73% used [0x00000000fbd50000, 0x00000000fd9116f8, 0x00000000fd911800, 0x00000000fe341000)
[11.889s][info ][gc,heap,exit ] Metaspace used 268K, committed 448K, reserved 1114112K
[11.889s][info ][gc,heap,exit ] class space used 17K, committed 128K, reserved 1048576K
2.ParallelGC test ok¶
[root@localhost jdk21]# java -XX:+UseParallelGC -XX:+PrintGCDetails -Xmx100m -Xms10m binarytrees 18
[0.013s][warning][gc] -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
[0.055s][info ][gc,init] CardTable entry size: 512
[0.057s][info ][gc ] Using Parallel
[0.067s][info ][gc,init] Version: 21.0.2+12 (release)
[0.067s][info ][gc,init] CPUs: 4 total, 4 available
[0.068s][info ][gc,init] Memory: 7678M
[0.070s][info ][gc,init] Large Page Support: Disabled
[0.070s][info ][gc,init] NUMA Support: Disabled
[0.070s][info ][gc,init] Compressed Oops: Enabled (32-bit)
[0.070s][info ][gc,init] Alignments: Space 512K, Generation 512K, Heap 2M
[0.070s][info ][gc,init] Heap Min Capacity: 10M
[0.070s][info ][gc,init] Heap Initial Capacity: 10M
[0.070s][info ][gc,init] Heap Max Capacity: 100M
[0.070s][info ][gc,init] Pre-touch: Disabled
[0.070s][info ][gc,init] Parallel Workers: 4
[0.487s][info ][gc,metaspace] CDS archive(s) mapped at: [0x0000003f37000000-0x0000003f37ca8000-0x0000003f37ca8000), size 13271040, SharedBaseAddress: 0x0000003f37000000, ArchiveRelocationMode: 1.
[0.487s][info ][gc,metaspace] Compressed class space mapped at: 0x0000003f38000000-0x0000003f78000000, reserved size: 1073741824
[0.487s][info ][gc,metaspace] Narrow klass base: 0x0000003f37000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
[0.821s][info ][gc,start ] GC(0) Pause Young (Allocation Failure)
[0.845s][info ][gc,heap ] GC(0) PSYoungGen: 2048K(2560K)->480K(2560K) Eden: 2048K(2048K)->0K(2048K) From: 0K(512K)->480K(512K)
[0.845s][info ][gc,heap ] GC(0) ParOldGen: 1053K(7168K)->2533K(7168K)
[0.845s][info ][gc,metaspace] GC(0) Metaspace: 70K(256K)->70K(256K) NonClass: 66K(128K)->66K(128K) Class: 3K(128K)->3K(128K)
[0.845s][info ][gc ] GC(0) Pause Young (Allocation Failure) 3M->2M(9M) 23.911ms
[0.845s][info ][gc,cpu ] GC(0) User=0.05s Sys=0.00s Real=0.02s
[0.856s][info ][gc,start ] GC(1) Pause Young (Allocation Failure)
[0.879s][info ][gc,heap ] GC(1) PSYoungGen: 2528K(2560K)->480K(4608K) Eden: 2048K(2048K)->0K(4096K) From: 480K(512K)->480K(512K)
[0.879s][info ][gc,heap ] GC(1) ParOldGen: 2533K(7168K)->4597K(7168K)
[0.879s][info ][gc,metaspace] GC(1) Metaspace: 70K(256K)->70K(256K) NonClass: 66K(128K)->66K(128K) Class: 3K(128K)->3K(128K)
[0.880s][info ][gc ] GC(1) Pause Young (Allocation Failure) 4M->4M(11M) 23.893ms
[0.880s][info ][gc,cpu ] GC(1) User=0.04s Sys=0.00s Real=0.02s
[0.887s][info ][gc,start ] GC(2) Pause Young (Allocation Failure)
[0.948s][info ][gc,heap ] GC(2) PSYoungGen: 4576K(4608K)->480K(4608K) Eden: 4096K(4096K)->0K(4096K) From: 480K(512K)->480K(512K)
[0.948s][info ][gc,heap ] GC(2) ParOldGen: 4597K(7168K)->8717K(9216K)
[0.948s][info ][gc,metaspace] GC(2) Metaspace: 70K(256K)->70K(256K) NonClass: 66K(128K)->66K(128K) Class: 3K(128K)->3K(128K)
[0.948s][info ][gc ] GC(2) Pause Young (Allocation Failure) 8M->8M(13M) 61.563ms
[0.948s][info ][gc,cpu ] GC(2) User=0.09s Sys=0.03s Real=0.06s
[0.949s][info ][gc,start ] GC(3) Pause Full (Ergonomics)
[0.949s][info ][gc,phases,start] GC(3) Marking Phase
[1.038s][info ][gc,phases ] GC(3) Marking Phase 89.011ms
[1.039s][info ][gc,phases,start] GC(3) Summary Phase
[1.039s][info ][gc,phases ] GC(3) Summary Phase 0.077ms
[1.039s][info ][gc,phases,start] GC(3) Adjust Roots
[1.043s][info ][gc,phases ] GC(3) Adjust Roots 4.648ms
[1.044s][info ][gc,phases,start] GC(3) Compaction Phase
......
[9.053s][info ][gc,heap ] GC(89) PSYoungGen: 20928K(20992K)->8640K(22016K) Eden: 13312K(13312K)->0K(11264K) From: 7616K(7680K)->8640K(10752K)
[9.053s][info ][gc,heap ] GC(89) ParOldGen: 26709K(34816K)->26709K(34816K)
[9.053s][info ][gc,metaspace ] GC(89) Metaspace: 267K(448K)->267K(448K) NonClass: 250K(320K)->250K(320K) Class: 17K(128K)->17K(128K)
[9.053s][info ][gc ] GC(89) Pause Young (Allocation Failure) 46M->34M(55M) 61.400ms
[9.053s][info ][gc,cpu ] GC(89) User=0.12s Sys=0.00s Real=0.07s
[9.086s][info ][gc,start ] GC(90) Pause Young (Allocation Failure)
[9.141s][info ][gc,heap ] GC(90) PSYoungGen: 19904K(22016K)->7616K(22528K) Eden: 11264K(11264K)->0K(11264K) From: 8640K(10752K)->7616K(11264K)
[9.141s][info ][gc,heap ] GC(90) ParOldGen: 26709K(34816K)->26709K(34816K)
[9.141s][info ][gc,metaspace ] GC(90) Metaspace: 267K(448K)->267K(448K) NonClass: 250K(320K)->250K(320K) Class: 17K(128K)->17K(128K)
[9.141s][info ][gc ] GC(90) Pause Young (Allocation Failure) 45M->33M(56M) 54.830ms
[9.141s][info ][gc,cpu ] GC(90) User=0.11s Sys=0.00s Real=0.06s
[9.174s][info ][gc,start ] GC(91) Pause Young (Allocation Failure)
[9.222s][info ][gc,heap ] GC(91) PSYoungGen: 18880K(22528K)->6592K(22528K) Eden: 11264K(11264K)->0K(11264K) From: 7616K(11264K)->6592K(11264K)
[9.222s][info ][gc,heap ] GC(91) ParOldGen: 26709K(34816K)->26709K(34816K)
[9.222s][info ][gc,metaspace ] GC(91) Metaspace: 267K(448K)->267K(448K) NonClass: 250K(320K)->250K(320K) Class: 17K(128K)->17K(128K)
[9.222s][info ][gc ] GC(91) Pause Young (Allocation Failure) 44M->32M(56M) 47.994ms
[9.222s][info ][gc,cpu ] GC(91) User=0.09s Sys=0.00s Real=0.05s
[9.257s][info ][gc,start ] GC(92) Pause Young (Allocation Failure)
[9.297s][info ][gc,heap ] GC(92) PSYoungGen: 17856K(22528K)->5536K(22528K) Eden: 11264K(11264K)->0K(11264K) From: 6592K(11264K)->5536K(11264K)
[9.297s][info ][gc,heap ] GC(92) ParOldGen: 26709K(34816K)->26709K(34816K)
[9.297s][info ][gc,metaspace ] GC(92) Metaspace: 267K(448K)->267K(448K) NonClass: 250K(320K)->250K(320K) Class: 17K(128K)->17K(128K)
[9.297s][info ][gc ] GC(92) Pause Young (Allocation Failure) 43M->31M(56M) 40.545ms
[9.298s][info ][gc,cpu ] GC(92) User=0.08s Sys=0.00s Real=0.04s
[9.331s][info ][gc,start ] GC(93) Pause Young (Allocation Failure)
[9.364s][info ][gc,heap ] GC(93) PSYoungGen: 16800K(22528K)->4544K(22528K) Eden: 11264K(11264K)->0K(11264K) From: 5536K(11264K)->4544K(11264K)
[9.364s][info ][gc,heap ] GC(93) ParOldGen: 26709K(34816K)->26709K(34816K)
[9.365s][info ][gc,metaspace ] GC(93) Metaspace: 267K(448K)->267K(448K) NonClass: 250K(320K)->250K(320K) Class: 17K(128K)->17K(128K)
[9.365s][info ][gc ] GC(93) Pause Young (Allocation Failure) 42M->30M(56M) 34.087ms
[9.365s][info ][gc,cpu ] GC(93) User=0.07s Sys=0.01s Real=0.04s
16 trees of depth 18 check: 8388592
long lived tree of depth 18 check: 524287
[9.454s][info ][gc,heap,exit ] Heap
[9.454s][info ][gc,heap,exit ] PSYoungGen total 22528K, used 12652K [0x00000000fdf00000, 0x0000000100000000, 0x0000000100000000)
[9.454s][info ][gc,heap,exit ] eden space 11264K, 71% used [0x00000000fdf00000,0x00000000fe6eb048,0x00000000fea00000)
[9.454s][info ][gc,heap,exit ] from space 11264K, 40% used [0x00000000ff500000,0x00000000ff970000,0x0000000100000000)
[9.454s][info ][gc,heap,exit ] to space 11264K, 0% used [0x00000000fea00000,0x00000000fea00000,0x00000000ff500000)
[9.454s][info ][gc,heap,exit ] ParOldGen total 34816K, used 26709K [0x00000000f9c00000, 0x00000000fbe00000, 0x00000000fdf00000)
[9.454s][info ][gc,heap,exit ] object space 34816K, 76% used [0x00000000f9c00000,0x00000000fb615730,0x00000000fbe00000)
[9.454s][info ][gc,heap,exit ] Metaspace used 272K, committed 448K, reserved 1114112K
[9.454s][info ][gc,heap,exit ] class space used 17K, committed 128K, reserved 1048576K
3.G1GC test ok¶
[root@localhost jdk21]# java -XX:+UseG1GC -XX:+PrintGCDetails -Xmx100m -Xms10m binarytrees 18
[0.013s][warning][gc] -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
[0.057s][info ][gc,init] CardTable entry size: 512
[0.071s][info ][gc ] Using G1
[0.103s][info ][gc,init] Version: 21.0.2+12 (release)
[0.103s][info ][gc,init] CPUs: 4 total, 4 available
[0.104s][info ][gc,init] Memory: 7678M
[0.105s][info ][gc,init] Large Page Support: Disabled
[0.105s][info ][gc,init] NUMA Support: Disabled
[0.105s][info ][gc,init] Compressed Oops: Enabled (32-bit)
[0.105s][info ][gc,init] Heap Region Size: 1M
[0.105s][info ][gc,init] Heap Min Capacity: 10M
[0.105s][info ][gc,init] Heap Initial Capacity: 10M
[0.105s][info ][gc,init] Heap Max Capacity: 100M
[0.105s][info ][gc,init] Pre-touch: Disabled
[0.105s][info ][gc,init] Parallel Workers: 4
[0.105s][info ][gc,init] Concurrent Workers: 1
[0.105s][info ][gc,init] Concurrent Refinement Workers: 4
[0.105s][info ][gc,init] Periodic GC: Disabled
[0.472s][info ][gc,metaspace] CDS archive(s) mapped at: [0x0000003f2f000000-0x0000003f2fca8000-0x0000003f2fca8000), size 13271040, SharedBaseAddress: 0x0000003f2f000000, ArchiveRelocationMode: 1.
[0.472s][info ][gc,metaspace] Compressed class space mapped at: 0x0000003f30000000-0x0000003f70000000, reserved size: 1073741824
[0.472s][info ][gc,metaspace] Narrow klass base: 0x0000003f2f000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
[0.843s][info ][gc,start ] GC(0) Pause Young (Normal) (G1 Evacuation Pause)
[0.849s][info ][gc,task ] GC(0) Using 2 workers of 4 for evacuation
[0.943s][info ][gc,phases ] GC(0) Pre Evacuate Collection Set: 3.6ms
[0.943s][info ][gc,phases ] GC(0) Merge Heap Roots: 1.9ms
[0.943s][info ][gc,phases ] GC(0) Evacuate Collection Set: 74.0ms
[0.943s][info ][gc,phases ] GC(0) Post Evacuate Collection Set: 7.0ms
[0.944s][info ][gc,phases ] GC(0) Other: 8.8ms
[0.944s][info ][gc,heap ] GC(0) Eden regions: 4->0(1)
[0.944s][info ][gc,heap ] GC(0) Survivor regions: 0->1(1)
[0.944s][info ][gc,heap ] GC(0) Old regions: 2->5
[0.945s][info ][gc,heap ] GC(0) Humongous regions: 0->0
[0.945s][info ][gc,metaspace] GC(0) Metaspace: 70K(256K)->70K(256K) NonClass: 66K(128K)->66K(128K) Class: 3K(128K)->3K(128K)
[0.946s][info ][gc ] GC(0) Pause Young (Normal) (G1 Evacuation Pause) 5M->5M(12M) 102.819ms
[0.946s][info ][gc,cpu ] GC(0) User=0.14s Sys=0.03s Real=0.11s
[0.951s][info ][gc,start ] GC(1) Pause Young (Concurrent Start) (G1 Evacuation Pause)
[0.951s][info ][gc,task ] GC(1) Using 2 workers of 4 for evacuation
[0.981s][info ][gc,phases ] GC(1) Pre Evacuate Collection Set: 0.9ms
[0.982s][info ][gc,phases ] GC(1) Merge Heap Roots: 0.3ms
[0.982s][info ][gc,phases ] GC(1) Evacuate Collection Set: 26.7ms
[0.982s][info ][gc,phases ] GC(1) Post Evacuate Collection Set: 1.0ms
[0.982s][info ][gc,phases ] GC(1) Other: 1.2ms
[0.982s][info ][gc,heap ] GC(1) Eden regions: 1->0(1)
[0.982s][info ][gc,heap ] GC(1) Survivor regions: 1->1(1)
[0.982s][info ][gc,heap ] GC(1) Old regions: 5->7
[0.982s][info ][gc,heap ] GC(1) Humongous regions: 0->0
[0.982s][info ][gc,metaspace] GC(1) Metaspace: 70K(256K)->70K(256K) NonClass: 66K(128K)->66K(128K) Class: 3K(128K)->3K(128K)
[0.983s][info ][gc ] GC(1) Pause Young (Concurrent Start) (G1 Evacuation Pause) 6M->6M(12M) 31.510ms
[0.983s][info ][gc,cpu ] GC(1) User=0.05s Sys=0.01s Real=0.03s
[0.984s][info ][gc ] GC(2) Concurrent Mark Cycle
[0.984s][info ][gc,marking ] GC(2) Concurrent Scan Root Regions
[0.990s][info ][gc,start ] GC(3) Pause Young (Normal) (G1 Evacuation Pause)
[0.990s][info ][gc,task ] GC(3) Using 2 workers of 4 for evacuation
[1.003s][info ][gc,marking ] GC(2) Concurrent Scan Root Regions 18.667ms
[1.003s][info ][gc,marking ] GC(2) Concurrent Mark
[1.003s][info ][gc,marking ] GC(2) Concurrent Mark From Roots
[1.004s][info ][gc,task ] GC(2) Using 1 workers of 1 for marking
[1.032s][info ][gc,phases ] GC(3) Pre Evacuate Collection Set: 0.4ms
[1.032s][info ][gc,phases ] GC(3) Merge Heap Roots: 0.4ms
[1.032s][info ][gc,phases ] GC(3) Evacuate Collection Set: 26.6ms
[1.032s][info ][gc,phases ] GC(3) Post Evacuate Collection Set: 1.0ms
......
[7.687s][info ][gc,heap ] GC(44) Humongous regions: 0->0
[7.687s][info ][gc,metaspace] GC(44) Metaspace: 260K(448K)->260K(448K) NonClass: 243K(320K)->243K(320K) Class: 17K(128K)->17K(128K)
[7.687s][info ][gc ] GC(44) Pause Young (Normal) (G1 Evacuation Pause) 68M->21M(88M) 34.733ms
[7.687s][info ][gc,cpu ] GC(44) User=0.06s Sys=0.00s Real=0.04s
[7.827s][info ][gc,start ] GC(45) Pause Young (Normal) (G1 Evacuation Pause)
[7.828s][info ][gc,task ] GC(45) Using 2 workers of 4 for evacuation
[7.863s][info ][gc,phases ] GC(45) Pre Evacuate Collection Set: 0.7ms
[7.863s][info ][gc,phases ] GC(45) Merge Heap Roots: 0.2ms
[7.863s][info ][gc,phases ] GC(45) Evacuate Collection Set: 31.0ms
[7.863s][info ][gc,phases ] GC(45) Post Evacuate Collection Set: 2.5ms
[7.863s][info ][gc,phases ] GC(45) Other: 0.5ms
[7.863s][info ][gc,heap ] GC(45) Eden regions: 48->0(50)
[7.863s][info ][gc,heap ] GC(45) Survivor regions: 4->4(7)
[7.863s][info ][gc,heap ] GC(45) Old regions: 18->18
[7.863s][info ][gc,heap ] GC(45) Humongous regions: 0->0
[7.863s][info ][gc,metaspace] GC(45) Metaspace: 260K(448K)->260K(448K) NonClass: 243K(320K)->243K(320K) Class: 17K(128K)->17K(128K)
[7.864s][info ][gc ] GC(45) Pause Young (Normal) (G1 Evacuation Pause) 69M->20M(91M) 36.304ms
[7.864s][info ][gc,cpu ] GC(45) User=0.06s Sys=0.01s Real=0.03s
[8.023s][info ][gc,start ] GC(46) Pause Young (Normal) (G1 Evacuation Pause)
[8.023s][info ][gc,task ] GC(46) Using 2 workers of 4 for evacuation
[8.076s][info ][gc,phases ] GC(46) Pre Evacuate Collection Set: 0.7ms
[8.077s][info ][gc,phases ] GC(46) Merge Heap Roots: 0.2ms
[8.077s][info ][gc,phases ] GC(46) Evacuate Collection Set: 50.7ms
[8.077s][info ][gc,phases ] GC(46) Post Evacuate Collection Set: 1.1ms
[8.077s][info ][gc,phases ] GC(46) Other: 0.5ms
[8.077s][info ][gc,heap ] GC(46) Eden regions: 50->0(48)
[8.077s][info ][gc,heap ] GC(46) Survivor regions: 4->6(7)
[8.077s][info ][gc,heap ] GC(46) Old regions: 18->18
[8.077s][info ][gc,heap ] GC(46) Humongous regions: 0->0
[8.077s][info ][gc,metaspace] GC(46) Metaspace: 260K(448K)->260K(448K) NonClass: 243K(320K)->243K(320K) Class: 17K(128K)->17K(128K)
[8.078s][info ][gc ] GC(46) Pause Young (Normal) (G1 Evacuation Pause) 70M->23M(91M) 54.827ms
[8.078s][info ][gc,cpu ] GC(46) User=0.11s Sys=0.00s Real=0.05s
16 trees of depth 18 check: 8388592
long lived tree of depth 18 check: 524287
[8.174s][info ][gc,heap,exit] Heap
[8.174s][info ][gc,heap,exit] garbage-first heap total 93184K, used 31857K [0x00000000f9c00000, 0x0000000100000000)
[8.174s][info ][gc,heap,exit] region size 1024K, 14 young (14336K), 6 survivors (6144K)
[8.174s][info ][gc,heap,exit] Metaspace used 263K, committed 448K, reserved 1114112K
[8.174s][info ][gc,heap,exit] class space used 17K, committed 128K, reserved 1048576K
4.ZGC test ok¶
[root@localhost jdk21]# java -XX:+UseZGC -XX:+PrintGCDetails -Xmx100m -Xms10m binarytrees 18
[0.012s][warning][gc] -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
[0.056s][info ][gc,init] Initializing The Z Garbage Collector
[0.056s][info ][gc,init] Version: 21.0.2+12 (release)
[0.057s][info ][gc,init] Using legacy single-generation mode
[0.059s][info ][gc,init] Probing address space for the highest valid bit: 37
[0.059s][info ][gc,init] NUMA Support: Disabled
[0.059s][info ][gc,init] CPUs: 4 total, 4 available
[0.063s][info ][gc,init] Memory: 7678M
[0.063s][info ][gc,init] Large Page Support: Disabled
[0.064s][info ][gc,init] GC Workers: 1 (dynamic)
[0.068s][info ][gc,init] Address Space Type: Contiguous/Unrestricted/Complete
[0.068s][info ][gc,init] Address Space Size: 1600M x 3 = 4800M
[0.068s][info ][gc,init] Heap Backing File: /memfd:java_heap
[0.069s][info ][gc,init] Heap Backing Filesystem: tmpfs (0x1021994)
[0.073s][info ][gc,init] Min Capacity: 10M
[0.074s][info ][gc,init] Initial Capacity: 10M
[0.074s][info ][gc,init] Max Capacity: 100M
[0.074s][info ][gc,init] Medium Page Size: N/A
[0.074s][info ][gc,init] Pre-touch: Disabled
[0.074s][info ][gc,init] Available space on backing filesystem: N/A
[0.083s][info ][gc,init] Uncommit: Enabled
[0.083s][info ][gc,init] Uncommit Delay: 300s
[0.115s][info ][gc,init] Runtime Workers: 1
[0.118s][info ][gc ] Using The Z Garbage Collector
[0.551s][info ][gc,metaspace] CDS archive(s) mapped at: [0x0000003d3b000000-0x0000003d3bca8000-0x0000003d3bca8000), size 13271040, SharedBaseAddress: 0x0000003d3b000000, ArchiveRelocationMode: 1.
[0.551s][info ][gc,metaspace] Compressed class space mapped at: 0x0000003d3c000000-0x0000003d7c000000, reserved size: 1073741824
[0.551s][info ][gc,metaspace] Narrow klass base: 0x0000003d3b000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
[1.492s][info ][gc,start ] GC(0) Garbage Collection (Warmup)
[1.494s][info ][gc,task ] GC(0) Using 1 workers
[1.507s][info ][gc,phases ] GC(0) Pause Mark Start 1.529ms
[1.771s][info ][gc,phases ] GC(0) Concurrent Mark 263.250ms
[1.775s][info ][gc,phases ] GC(0) Pause Mark End 0.705ms
[1.776s][info ][gc,phases ] GC(0) Concurrent Mark Free 0.146ms
[1.791s][info ][gc,phases ] GC(0) Concurrent Process Non-Strong References 14.184ms
[1.791s][info ][gc,phases ] GC(0) Concurrent Reset Relocation Set 0.083ms
......
[21.746s][info ][gc,heap ] GC(45) Mark Start Mark End Relocate Start Relocate End High Low
[21.746s][info ][gc,heap ] GC(45) Capacity: 100M (100%) 100M (100%) 100M (100%) 100M (100%) 100M (100%) 100M (100%)
[21.746s][info ][gc,heap ] GC(45) Free: 0M (0%) 0M (0%) 72M (72%) 70M (70%) 78M (78%) 0M (0%)
[21.746s][info ][gc,heap ] GC(45) Used: 100M (100%) 100M (100%) 28M (28%) 30M (30%) 100M (100%) 22M (22%)
[21.747s][info ][gc,heap ] GC(45) Live: - 17M (17%) 17M (17%) 17M (17%) - -
[21.747s][info ][gc,heap ] GC(45) Allocated: - 0M (0%) 6M (6%) 11M (12%) - -
[21.747s][info ][gc,heap ] GC(45) Garbage: - 82M (83%) 4M (5%) 0M (1%) - -
[21.747s][info ][gc,heap ] GC(45) Reclaimed: - - 78M (78%) 81M (82%) - -
[21.747s][info ][gc ] GC(45) Garbage Collection (Allocation Stall) 100M(100%)->30M(30%)
[21.790s][info ][gc,start ] GC(46) Garbage Collection (Allocation Rate)
[21.790s][info ][gc,task ] GC(46) Using 1 workers
[21.794s][info ][gc,phases ] GC(46) Pause Mark Start 0.139ms
16 trees of depth 18 check: 8388592
long lived tree of depth 18 check: 524287
[22.166s][info ][gc ] GC(46) Garbage Collection (Allocation Rate) Aborted
[22.170s][info ][gc,heap,exit] Heap
[22.170s][info ][gc,heap,exit] ZHeap used 68M, capacity 100M, max capacity 100M
[22.170s][info ][gc,heap,exit] Metaspace used 331K, committed 512K, reserved 1114112K
[22.170s][info ][gc,heap,exit] class space used 15K, committed 128K, reserved 1048576K
5.Shenandoah GC test ok¶
[root@localhost jdk21]# java -XX:+UseShenandoahGC -XX:+PrintGCDetails -Xmx100m -Xms10m binarytrees 18
[0.012s][warning][gc] -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
[0.069s][info ][gc] Heuristics ergonomically sets -XX:+ExplicitGCInvokesConcurrent
[0.070s][info ][gc] Heuristics ergonomically sets -XX:+ShenandoahImplicitGCInvokesConcurrent
[0.076s][info ][gc] Using Shenandoah
[0.088s][info ][gc,ergo] Pacer for Idle. Initial: 2048K, Alloc Tax Rate: 1.0x
[0.091s][info ][gc,init] Version: 21.0.2+12 (release)
[0.091s][info ][gc,init] CPUs: 4 total, 4 available
[0.092s][info ][gc,init] Memory: 7678M
[0.093s][info ][gc,init] Large Page Support: Disabled
[0.093s][info ][gc,init] NUMA Support: Disabled
[0.093s][info ][gc,init] Compressed Oops: Enabled (32-bit)
[0.093s][info ][gc,init] Heap Min Capacity: 10M
[0.093s][info ][gc,init] Heap Initial Capacity: 10M
[0.093s][info ][gc,init] Heap Max Capacity: 100M
[0.093s][info ][gc,init] Pre-touch: Disabled
[0.093s][info ][gc,init] Mode: Snapshot-At-The-Beginning (SATB)
[0.093s][info ][gc,init] Heuristics: Adaptive
[0.093s][info ][gc,init] Heap Region Count: 400
[0.093s][info ][gc,init] Heap Region Size: 256K
[0.093s][info ][gc,init] TLAB Size Max: 256K
[0.093s][info ][gc,init] Humongous Object Threshold: 256K
[0.093s][info ][gc,init] Parallel Workers: 2
[0.093s][info ][gc,init] Concurrent Workers: 1
[0.475s][info ][gc,metaspace] CDS archive(s) mapped at: [0x0000003f47000000-0x0000003f47ca8000-0x0000003f47ca8000), size 13271040, SharedBaseAddress: 0x0000003f47000000, ArchiveRelocationMode: 1.
[0.476s][info ][gc,metaspace] Compressed class space mapped at: 0x0000003f48000000-0x0000003f88000000, reserved size: 1073741824
[0.476s][info ][gc,metaspace] Narrow klass base: 0x0000003f47000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
[1.316s][info ][gc ] Trigger: Learning 1 of 5. Free (71424K) is below initial threshold (71680K)
[1.318s][info ][gc,ergo ] Free: 71424K, Max: 256K regular, 71424K humongous, Frag: 0% external, 0% internal; Reserve: 5120K, Max: 256K
......
[21.001s][info ][gc,stats ]
[21.002s][info ][gc,stats ] GC STATISTICS:
[21.002s][info ][gc,stats ] "(G)" (gross) pauses include VM time: time to notify and block threads, do the pre-
[21.002s][info ][gc,stats ] and post-safepoint housekeeping. Use -Xlog:safepoint+stats to dissect.
[21.002s][info ][gc,stats ] "(N)" (net) pauses are the times spent in the actual GC code.
[21.002s][info ][gc,stats ] "a" is average time for each phase, look at levels to see if average makes sense.
[21.003s][info ][gc,stats ] "lvls" are quantiles: 0% (minimum), 25%, 50% (median), 75%, 100% (maximum).
[21.003s][info ][gc,stats ]
[21.003s][info ][gc,stats ] All times are wall-clock times, except per-root-class counters, that are sum over
[21.003s][info ][gc,stats ] all workers. Dividing the <total> over the root stage time estimates parallelism.
[21.003s][info ][gc,stats ]
[21.003s][info ][gc,stats ] Pacing delays are measured from entering the pacing code till exiting it. Therefore,
[21.003s][info ][gc,stats ] observed pacing delays may be higher than the threshold when paced thread spent more
[21.004s][info ][gc,stats ] time in the pacing code. It usually happens when thread is de-scheduled while paced,
[21.004s][info ][gc,stats ] OS takes longer to unblock the thread, or JVM experiences an STW pause.
[21.004s][info ][gc,stats ]
[21.004s][info ][gc,stats ] Higher delay would prevent application outpacing the GC, but it will hide the GC latencies
[21.004s][info ][gc,stats ] from the STW pause times. Pacing affects the individual threads, and so it would also be
[21.004s][info ][gc,stats ] invisible to the usual profiling tools, but would add up to end-to-end application latency.
[21.004s][info ][gc,stats ] Raise max pacing delay with care.
[21.004s][info ][gc,stats ]
[21.005s][info ][gc,stats ] Concurrent Reset = 0.075 s (a = 1627 us) (n = 46) (lvls, us = 650, 945, 1152, 1465, 9356)
[21.006s][info ][gc,stats ] Pause Init Mark (G) = 0.175 s (a = 3815 us) (n = 46) (lvls, us = 689, 2891, 3340, 3438, 17392)
[21.006s][info ][gc,stats ] Pause Init Mark (N) = 0.030 s (a = 645 us) (n = 46) (lvls, us = 322, 424, 508, 619, 5640)
[21.006s][info ][gc,stats ] Update Region States = 0.002 s (a = 39 us) (n = 46) (lvls, us = 23, 28, 34, 39, 226)
[21.006s][info ][gc,stats ] Concurrent Mark Roots = 0.208 s (a = 4516 us) (n = 46) (lvls, us = 1621, 2324, 2695, 3457, 28033)
[21.007s][info ][gc,stats ] CMR: <total> = 0.162 s (a = 3516 us) (n = 46) (lvls, us = 1191, 1523, 1738, 2520, 25125)
[21.007s][info ][gc,stats ] CMR: Thread Roots = 0.132 s (a = 2874 us) (n = 46) (lvls, us = 1035, 1289, 1504, 2051, 18727)
[21.007s][info ][gc,stats ] CMR: VM Strong Roots = 0.006 s (a = 131 us) (n = 46) (lvls, us = 24, 32, 36, 45, 2254)
[21.007s][info ][gc,stats ] CMR: CLDG Roots = 0.024 s (a = 511 us) (n = 46) (lvls, us = 133, 158, 170, 201, 5489)
[21.007s][info ][gc,stats ] Concurrent Marking = 11.696 s (a = 259914 us) (n = 45) (lvls, us = 166016, 175781, 214844, 269531, 770997)
[21.007s][info ][gc,stats ] Pause Final Mark (G) = 0.159 s (a = 3544 us) (n = 45) (lvls, us = 1016, 1387, 2402, 5195, 9668)
[21.007s][info ][gc,stats ] Pause Final Mark (N) = 0.066 s (a = 1474 us) (n = 45) (lvls, us = 668, 852, 1191, 1680, 4719)
[21.008s][info ][gc,stats ] Finish Mark = 0.027 s (a = 600 us) (n = 45) (lvls, us = 223, 273, 426, 848, 1392)
[21.008s][info ][gc,stats ] Update Region States = 0.003 s (a = 66 us) (n = 45) (lvls, us = 25, 30, 32, 36, 1397)
[21.008s][info ][gc,stats ] Choose Collection Set = 0.012 s (a = 270 us) (n = 45) (lvls, us = 125, 141, 188, 232, 1838)
[21.008s][info ][gc,stats ] Rebuild Free Set = 0.001 s (a = 25 us) (n = 45) (lvls, us = 18, 20, 24, 26, 55)
[21.008s][info ][gc,stats ] Concurrent Thread Roots = 0.015 s (a = 3814 us) (n = 4) (lvls, us = 2793, 2793, 3301, 3730, 5399)
[21.009s][info ][gc,stats ] CTR: <total> = 0.012 s (a = 2977 us) (n = 4) (lvls, us = 1621, 1621, 2695, 3359, 4193)
[21.010s][info ][gc,stats ] CTR: Thread Roots = 0.012 s (a = 2977 us) (n = 4) (lvls, us = 1621, 1621, 2695, 3359, 4193)
[21.010s][info ][gc,stats ] Concurrent Weak References = 0.064 s (a = 1419 us) (n = 45) (lvls, us = 504, 740, 902, 1680, 6090)
[21.010s][info ][gc,stats ] CWRF: <total> = 0.006 s (a = 134 us) (n = 45) (lvls, us = 21, 28, 44, 60, 1902)
[21.010s][info ][gc,stats ] CWRF: Weak References = 0.006 s (a = 134 us) (n = 45) (lvls, us = 21, 28, 44, 60, 1902)
[21.010s][info ][gc,stats ] Concurrent Weak Roots = 0.268 s (a = 5957 us) (n = 45) (lvls, us = 1465, 2656, 3848, 5957, 42987)
[21.010s][info ][gc,stats ] Roots = 0.161 s (a = 3582 us) (n = 45) (lvls, us = 996, 1270, 1523, 2266, 40039)
[21.010s][info ][gc,stats ] CWR: <total> = 0.128 s (a = 2852 us) (n = 45) (lvls, us = 805, 980, 1094, 1914, 32050)
[21.010s][info ][gc,stats ] CWR: Code Cache Roots = 0.086 s (a = 1910 us) (n = 45) (lvls, us = 283, 391, 459, 1035, 27231)
[21.010s][info ][gc,stats ] CWR: VM Weak Roots = 0.041 s (a = 921 us) (n = 45) (lvls, us = 498, 521, 602, 730, 5338)
[21.011s][info ][gc,stats ] CWR: CLDG Roots = 0.001 s (a = 21 us) (n = 45) (lvls, us = 8, 13, 20, 24, 68)
[21.011s][info ][gc,stats ] Rendezvous = 0.088 s (a = 1949 us) (n = 45) (lvls, us = 143, 613, 1270, 2715, 6712)
[21.011s][info ][gc,stats ] Concurrent Cleanup = 0.019 s (a = 412 us) (n = 45) (lvls, us = 178, 250, 309, 477, 1029)
[21.011s][info ][gc,stats ] Concurrent Class Unloading = 0.443 s (a = 9849 us) (n = 45) (lvls, us = 3809, 6367, 7734, 11523, 43729)
[21.011s][info ][gc,stats ] Unlink Stale = 0.351 s (a = 7806 us) (n = 45) (lvls, us = 3184, 5527, 6113, 8711, 35566)
[21.011s][info ][gc,stats ] System Dictionary = 0.003 s (a = 60 us) (n = 45) (lvls, us = 19, 34, 45, 59, 299)
[21.011s][info ][gc,stats ] Weak Class Links = 0.000 s (a = 3 us) (n = 45) (lvls, us = 1, 2, 3, 4, 15)
[21.011s][info ][gc,stats ] Code Roots = 0.347 s (a = 7705 us) (n = 45) (lvls, us = 3125, 5469, 6055, 8555, 34749)
[21.011s][info ][gc,stats ] Rendezvous = 0.067 s (a = 1491 us) (n = 45) (lvls, us = 148, 238, 996, 2051, 5240)
[21.011s][info ][gc,stats ] Purge Unlinked = 0.007 s (a = 151 us) (n = 45) (lvls, us = 36, 42, 50, 66, 3428)
[21.011s][info ][gc,stats ] Code Roots = 0.004 s (a = 99 us) (n = 45) (lvls, us = 4, 6, 8, 11, 3089)
[21.012s][info ][gc,stats ] CLDG = 0.002 s (a = 46 us) (n = 45) (lvls, us = 23, 31, 37, 45, 320)
[21.012s][info ][gc,stats ] Exception Caches = 0.000 s (a = 2 us) (n = 45) (lvls, us = 1, 2, 2, 2, 11)
[21.012s][info ][gc,stats ] Concurrent Strong Roots = 0.007 s (a = 1679 us) (n = 4) (lvls, us = 842, 842, 1543, 1621, 2684)
[21.012s][info ][gc,stats ] CSR: <total> = 0.004 s (a = 891 us) (n = 4) (lvls, us = 326, 326, 625, 1113, 1483)
[21.012s][info ][gc,stats ] CSR: VM Strong Roots = 0.001 s (a = 350 us) (n = 4) (lvls, us = 37, 37, 105, 225, 1033)
[21.013s][info ][gc,stats ] CSR: CLDG Roots = 0.002 s (a = 541 us) (n = 4) (lvls, us = 219, 219, 449, 588, 906)
[21.013s][info ][gc,stats ] Concurrent Evacuation = 0.029 s (a = 7149 us) (n = 4) (lvls, us = 1270, 1270, 3809, 5957, 17524)
[21.014s][info ][gc,stats ] Pause Final Roots (G) = 0.140 s (a = 3415 us) (n = 41) (lvls, us = 1152, 2344, 3496, 4258, 6024)
[21.014s][info ][gc,stats ] Pause Final Roots (N) = 0.015 s (a = 361 us) (n = 41) (lvls, us = 162, 230, 291, 379, 1016)
[21.014s][info ][gc,stats ] Pause Init Update Refs (G) = 0.014 s (a = 3556 us) (n = 4) (lvls, us = 2129, 2129, 2324, 4590, 5148)
[21.014s][info ][gc,stats ] Pause Init Update Refs (N) = 0.003 s (a = 635 us) (n = 4) (lvls, us = 268, 268, 303, 801, 1167)
[21.015s][info ][gc,stats ] Manage GCLABs = 0.000 s (a = 81 us) (n = 4) (lvls, us = 21, 21, 42, 53, 207)
[21.015s][info ][gc,stats ] Concurrent Update Refs = 0.992 s (a = 247933 us) (n = 4) (lvls, us = 210938, 210938, 212891, 220703, 343534)
[21.015s][info ][gc,stats ] Concurrent Update Thread Roots = 0.012 s (a = 2986 us) (n = 4) (lvls, us = 2539, 2539, 2910, 2949, 3507)
[21.016s][info ][gc,stats ] Pause Final Update Refs (G) = 0.010 s (a = 2385 us) (n = 4) (lvls, us = 691, 691, 813, 3125, 4906)
[21.016s][info ][gc,stats ] Pause Final Update Refs (N) = 0.002 s (a = 601 us) (n = 4) (lvls, us = 322, 322, 498, 529, 1053)
[21.016s][info ][gc,stats ] Update Region States = 0.000 s (a = 45 us) (n = 4) (lvls, us = 22, 22, 29, 34, 93)
[21.016s][info ][gc,stats ] Trash Collection Set = 0.000 s (a = 51 us) (n = 4) (lvls, us = 13, 13, 14, 14, 165)
[21.016s][info ][gc,stats ] Rebuild Free Set = 0.000 s (a = 50 us) (n = 4) (lvls, us = 23, 23, 26, 74, 76)
[21.017s][info ][gc,stats ] Concurrent Cleanup = 0.001 s (a = 255 us) (n = 4) (lvls, us = 189, 189, 211, 211, 405)
[21.017s][info ][gc,stats ] Pacing = 7.413 s (a = 164725 us) (n = 45) (lvls, us = 0, 107422, 154297, 203125, 401837)
[21.017s][info ][gc,stats ]
[21.017s][info ][gc,stats ]
[21.017s][info ][gc,stats ] Under allocation pressure, concurrent cycles may cancel, and either continue cycle
[21.017s][info ][gc,stats ] under stop-the-world pause or result in stop-the-world Full GC. Increase heap size,
[21.017s][info ][gc,stats ] tune GC heuristics, set more aggressive pacing delay, or lower allocation rate
[21.017s][info ][gc,stats ] to avoid Degenerated and Full GC cycles.
[21.017s][info ][gc,stats ]
[21.017s][info ][gc,stats ] 45 successful concurrent GCs
[21.017s][info ][gc,stats ] 0 invoked explicitly
[21.017s][info ][gc,stats ] 0 invoked implicitly
[21.018s][info ][gc,stats ]
[21.018s][info ][gc,stats ] 0 Degenerated GCs
[21.018s][info ][gc,stats ] 0 caused by allocation failure
[21.018s][info ][gc,stats ] 0 upgraded to Full GC
[21.018s][info ][gc,stats ]
[21.018s][info ][gc,stats ] 0 Full GCs
[21.018s][info ][gc,stats ] 0 invoked explicitly
[21.018s][info ][gc,stats ] 0 invoked implicitly
[21.018s][info ][gc,stats ] 0 caused by allocation failure
[21.018s][info ][gc,stats ] 0 upgraded from Degenerated GC
[21.018s][info ][gc,stats ]
[21.018s][info ][gc,stats ]
6. Epsilon GC test ok¶
[root@localhost jdk21]# java -XX:+UnlockExperimentalVMOptions -XX:+UseEpsilonGC -XX:+PrintGCDetails -Xmx100m -Xms10m binarytrees 12
[0.012s][warning][gc] -XX:+PrintGCDetails is deprecated. Will use -Xlog:gc* instead.
[0.053s][info ][gc] Using Epsilon
[0.054s][info ][gc,init] Version: 21.0.2+12 (release)
[0.054s][info ][gc,init] CPUs: 4 total, 4 available
[0.055s][info ][gc,init] Memory: 7678M
[0.055s][info ][gc,init] Large Page Support: Disabled
[0.055s][info ][gc,init] NUMA Support: Disabled
[0.055s][info ][gc,init] Compressed Oops: Enabled (32-bit)
[0.056s][info ][gc,init] Heap Min Capacity: 10M
[0.056s][info ][gc,init] Heap Initial Capacity: 10M
[0.056s][info ][gc,init] Heap Max Capacity: 100M
[0.056s][info ][gc,init] Pre-touch: Disabled
[0.056s][warning][gc,init] Consider setting -Xms equal to -Xmx to avoid resizing hiccups
[0.056s][warning][gc,init] Consider enabling -XX:+AlwaysPreTouch to avoid memory commit hiccups
[0.056s][info ][gc,init] TLAB Size Max: 4M
[0.056s][info ][gc,init] TLAB Size Elasticity: 1.10x
[0.056s][info ][gc,init] TLAB Size Decay Time: 1000ms
[0.408s][info ][gc,metaspace] CDS archive(s) mapped at: [0x0000003f33000000-0x0000003f33ca8000-0x0000003f33ca8000), size 13271040, SharedBaseAddress: 0x0000003f33000000, ArchiveRelocationMode: 1.
[0.410s][info ][gc,metaspace] Compressed class space mapped at: 0x0000003f34000000-0x0000003f74000000, reserved size: 1073741824
[0.410s][info ][gc,metaspace] Narrow klass base: 0x0000003f33000000, Narrow klass shift: 0, Narrow klass range: 0x100000000
stretch tree of depth 13 check: 16383
[1.047s][info ][gc ] Heap: 100M reserved, 10240K (10.00%) committed, 5285K (5.16%) used
[1.047s][info ][gc,metaspace] Metaspace: 1088M reserved, 384K (0.03%) committed, 228K (0.02%) used
4096 trees of depth 4 check: 126976
1024 trees of depth 6 check: 130048
[1.252s][info ][gc ] Heap: 100M reserved, 100M (100.00%) committed, 10406K (10.16%) used
[1.252s][info ][gc,metaspace] Metaspace: 1088M reserved, 384K (0.03%) committed, 238K (0.02%) used
256 trees of depth 8 check: 130816
64 trees of depth 10 check: 131008
[1.282s][info ][gc ] Heap: 100M reserved, 100M (100.00%) committed, 15526K (15.16%) used
[1.282s][info ][gc,metaspace] Metaspace: 1088M reserved, 384K (0.03%) committed, 238K (0.02%) used
16 trees of depth 12 check: 131056
long lived tree of depth 12 check: 8191
[1.321s][info ][gc,heap,exit] Heap
[1.321s][info ][gc,heap,exit] Epsilon Heap
[1.321s][info ][gc,heap,exit] Allocation space:
[1.322s][info ][gc,heap,exit] space 102400K, 17% used [0x00000000f9c00000, 0x00000000fad2a3e8, 0x0000000100000000)
[1.322s][info ][gc,heap,exit] Metaspace used 241K, committed 384K, reserved 1114112K
[1.322s][info ][gc,heap,exit] class space used 17K, committed 128K, reserved 1048576K
[1.322s][info ][gc ] Heap: 100M reserved, 100M (100.00%) committed, 17576K (17.17%) used
[1.322s][info ][gc,metaspace] Metaspace: 1088M reserved, 384K (0.03%) committed, 241K (0.02%) used
7.ParNewGC deprecated¶
ParNewGC 在jdk11之后均以废弃;
8.ParallelOldGC deprecated¶
ParallelOldGC 在jdk21中被废弃;
9.ConMarkSweepGC deprecated¶
ConMarkSweepGC在jdk21中被废弃;