Add gc-basics: Java garbage collection explained and measured on JDK 25, 27, 28 EA

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_017ic4b44MquEzmd9QMkZCd7
This commit is contained in:
asmhatre
2026-11-24 06:46:39 +05:30
co-authored by Claude Sonnet 5.5
parent f7b6c1efca
commit 876ae1bb5c
36 changed files with 948 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
# What one System.gc() costs (JDK 25, G1, 150 MB live)
## default
[0.187s][info][gc] GC(7) Pause Full (System.gc()) 156M->154M(267M) 22.122ms
System.gc() #1 took 22.5 ms
[0.224s][info][gc] GC(8) Pause Full (System.gc()) 155M->154M(267M) 18.764ms
System.gc() #2 took 18.9 ms
[0.238s][info][gc] GC(9) Pause Full (System.gc()) 155M->154M(267M) 13.827ms
System.gc() #3 took 14.0 ms
live chunks still referenced: 153600
## -XX:+DisableExplicitGC
System.gc() #1 took 0.1 ms
System.gc() #2 took 0.0 ms
System.gc() #3 took 0.0 ms
live chunks still referenced: 153600
## -XX:+ExplicitGCInvokesConcurrent
[0.203s][info][gc] GC(7) Pause Young (Concurrent Start) (System.gc()) 168M->168M(267M) 8.496ms
System.gc() #1 took 34.4 ms
[0.261s][info][gc] GC(9) Pause Young (Concurrent Start) (System.gc()) 168M->169M(285M) 4.044ms
System.gc() #2 took 31.7 ms
[0.290s][info][gc] GC(11) Pause Young (Concurrent Start) (System.gc()) 169M->168M(287M) 0.919ms
System.gc() #3 took 22.5 ms
live chunks still referenced: 153600
## ZGC
System.gc() #1 took 47.5 ms
System.gc() #2 took 23.6 ms
System.gc() #3 took 19.2 ms
live chunks still referenced: 153600