JVM Tuning in 2026: The Defaults Still Leave Money
JVM tuning matters less than it used to; still matters more than people remember.
Why some tuning still matters
Defaults work for 80% of workloads. The other 20% need attention.
At scale, modest tuning saves real infrastructure.
Four parameters
- -Xmx / -Xms, max/min heap.
- -XX:MaxRAMPercentage, container-aware.
- -XX:+UseZGC / G1GC, GC choice.
- -XX:+ParallelRefProcEnabled, parallel ref processing.
GC choice in 2026
ZGC: low pause; large heap.
G1GC: balanced; default.
Shenandoah: GC pause focused.
For most apps in 2026: G1GC default; ZGC if pause time matters more than throughput.
Diagnostic tooling
JFR (Java Flight Recorder): production-safe.
async-profiler: low overhead.
Eclipse MAT for heap dumps.
jstack for thread dumps.
Antipatterns
- -Xmx absent in containers. JVM does not know its memory limit; OOMKill.
- Manual GC choices ignoring workload. Wrong choice.
- No JFR in production. Slow to diagnose.
What to do this week
Three moves. (1) Apply this pattern to your slowest production endpoint. (2) Measure p99 before/after. (3) Document the win and ship the runbook so the team can reproduce.