Tuning Java's G1 Garbage Collector for Realtime Services
summary
G1 is tuned for MQTT by forcing frequent tenured cleanup: G1OldCSetRegionThresholdPercent=50%, InitiatingHeapOccupancyPercent=0%, G1MixedGCLiveThresholdPercent=90% and reducing mixed GC target from 8 to 4 so mixed GCs prune tenured regions aggressively instead of waiting for 65% occupancy. This prevents full GCs, bends tenured usage to active connections, and yields >10% server footprint reduction and about 10x p99/p95/p90 latency improvement when measured with long canaries and realistic pause targets.
AI-written summary · about
chapters (8)
- 0:00Intro
- 0:44Scaling
- 6:56Collection Life Cycle
- 10:00What does tenured mean
- 11:01False dichotomies
- 12:06Problem solving
- 14:29Tuning options
- 19:13QA








