Complete companion suite for the ankurm.com guide. Everything was compiled and
executed on java 25.0.3+9-LTS-195 (AMD Ryzen 5 5600U, Windows 11); every file
under results/ is unedited program output.
Code
latency/ open-loop latency harness that measures from intended arrival, so
coordinated omission is accounted for rather than hidden. Reports
response time and service time side by side; the gap reached 2910x
on G1.
jmh/ four microbenchmarks isolating one mechanism each: TLAB allocation,
the ZGC load barrier (with a primitive-load control), the write
barrier (with null / old-to-old / primitive controls), and promotion
pressure.
tuning/ provokes ZGC allocation stalls and reads its own JFR recording back,
grouped by page class. jdk.ZAllocationStall is enabled without a
threshold, because the 10 ms default hides most stalls.
internals/ ZGC page classes vs G1 humongous, read from the live VM via
HotSpotDiagnosticMXBean and jdk.ZPageAllocation events.
analysis/ unified GC log parser that keeps stop-the-world pauses and
concurrent phases in separate buckets.
env/ environment capture; proves generational mode from JMX bean names.
Docs
Eight chapters covering the JEP 439/474/490 timeline, colored pointers and both
barriers, allocation stalls, a full flag reference, logging and JFR, benchmark
methodology, corner cases, and a decision procedure.
Headline result (60 s, 20k req/s, 2 GB heap, ~585 MB live)
p50 ZGC 0.006 ms G1 0.005 ms
p99.9 ZGC 1.437 ms G1 95.169 ms
total STW time ZGC 1.503 ms G1 1,139.624 ms
35 lines
1.4 KiB
Plaintext
35 lines
1.4 KiB
Plaintext
=== Runtime ===
|
|
java.version : 25.0.3
|
|
java.vm.name : Java HotSpot(TM) 64-Bit Server VM
|
|
java.vm.version : 25.0.3+9-LTS-195
|
|
java.vendor : Oracle Corporation
|
|
os.name / os.arch : Windows 11 / amd64
|
|
availableProcessors : 12
|
|
maxMemory (-Xmx) : 2,147,483,648 bytes (2048 MB)
|
|
totalMemory (now) : 2,147,483,648 bytes (2048 MB)
|
|
|
|
=== Collector in use ===
|
|
bean: ZGC Minor Cycles count=0 timeMs=0
|
|
bean: ZGC Minor Pauses count=0 timeMs=0
|
|
bean: ZGC Major Cycles count=0 timeMs=0
|
|
bean: ZGC Major Pauses count=0 timeMs=0
|
|
generational? : yes (separate young + old cycles reported)
|
|
|
|
=== Memory pools ===
|
|
CodeHeap 'non-nmethods' type=Non-heap memory max=5,832,704 bytes (6 MB)
|
|
Metaspace type=Non-heap memory max=unbounded
|
|
CodeHeap 'profiled nmethods' type=Non-heap memory max=122,880,000 bytes (117 MB)
|
|
Compressed Class Space type=Non-heap memory max=1,073,741,824 bytes (1024 MB)
|
|
ZGC Old Generation type=Heap memory max=2,147,483,648 bytes (2048 MB)
|
|
ZGC Young Generation type=Heap memory max=2,147,483,648 bytes (2048 MB)
|
|
CodeHeap 'non-profiled nmethods' type=Non-heap memory max=122,945,536 bytes (117 MB)
|
|
|
|
=== JVM arguments actually in effect ===
|
|
-XX:+UseZGC
|
|
-Xms2g
|
|
-Xmx2g
|
|
--add-modules=ALL-DEFAULT
|
|
|
|
Tip: dump every ergonomic value the JVM chose with
|
|
java -XX:+UseZGC -Xms2g -Xmx2g -XX:+PrintFlagsFinal -version
|