ATM10 GC Pause Spike >200ms: G1 Evacuation & Humongous Objects
When 450+ NeoForge mods allocate transient NBT and chunk arrays across a 16-24 GB heap, default G1GC young/mixed collections trigger 200-480 ms stop-the-world freezes.
Measured ATM10 JVM & Spark Profile
ChunkGC Bench logs show G1GC humongous object allocations (>8 MB arrays during AE2 pattern indexing or multi-chunk packet serialization) bypass young-gen regions and force full evacuation pauses. Switching to Java 21 Generational ZGC shifts marking and compaction off the main tick thread.
| Subsystem / Signal | Measured Target | Operational Impact |
|---|---|---|
| G1GC Untuned (18 GB Heap) | 220 - 480 ms STW | Audible rubber-banding & Watchdog warnings |
| G1GC Aikar (-XX:G1HeapRegionSize=16M) | 28 - 65 ms pause | Acceptable up to 16 GB heap on 16 players |
| Generational ZGC (-XX:+ZGenerational) | 0.4 - 1.8 ms pause | Maintains 20.0 TPS across 16-40 players |
Step-by-Step Triage & Config Remediation
- Verify Java 21 runtime: Run java -version and confirm OpenJDK/Temurin 21.0.4+ before enabling -XX:+ZGenerational.
- Match -Xms to -Xmx: Lock initial and max heap identically (for example -Xms12G -Xmx12G on a 16 GB node) to eliminate OS page faults.
- Enable Generational ZGC: Add -XX:+UseZGC -XX:+ZGenerational -XX:+AlwaysPreTouch -XX:+DisableExplicitGC in user_jvm_args.txt.
-Xms20G -Xmx20G -XX:+UseZGC -XX:+ZGenerational -XX:+AlwaysPreTouch -XX:+DisableExplicitGC
Diagnostic FAQ
Why do GC pauses get worse above 16 GB heap on G1GC?
Larger heaps accumulate more live long-lived chunk and AE2 cache data, extending G1 mixed evacuation scans beyond 200 ms unless region size and reserve ratios are tuned or ZGC is enabled.
Does Generational ZGC increase CPU usage?
ZGC uses concurrent background GC threads (about 6-10% extra multi-core CPU) while keeping the single main Minecraft tick thread uninterrupted.