Java 25 in Production: Memory Dieting to Tame Latency and Garbage Collection
summary
Production stack upgrades to Java 25 plus re-enabling Compressed OOPs and turning on Compact Object Headers shrinks object headers and lets the heap be reduced from ~28 GB to ~18–24 GB (≈36% reduction), cutting minor-GC time to ~1% and P95 latency by about 60% toward an 800 ms SLO. Observability uses Datadog, deployments run on Kubernetes (carpenter/castai), and adding a JVM warm‑up synthetic load (20s pre-ready delay) removes 5s cold-start spikes, dropping deploy-time P95 to <2s.
AI-written summary · about
chapters (17)
- 0:00Introduction and context
- 1:05What is memory dieting
- 3:35Picnic’s operational excellence
- 5:23Homepage latency issues
- 7:49Minor GC spikes investigation
- 11:19The Avengers analogy
- 12:01Infra changes and compressed Oops
- 13:29Understanding compressed Oops
- 19:33Upgrading to Java 25
- 20:34G1GC improvements in Java 25
- 21:17Java object headers explained
- 24:30Compact object headers
- 26:17Live demo of object size reduction
- 33:08Production impact of optimizations
- 36:00Deployment latency spikes
- 37:02JVM warm-up for cold starts
- 40:56Key takeaways and summary
