CodeName OneShai Almog7 min readintermediate
What Go Taught Us About Java Garbage Collection
Summary
ParparVM’s GC was tuned by lowering the allocation‑trigger floor, adding configurable thresholds, parallel marking, mutator assistance, and proper weak/soft reference handling. These changes cut RSS from 98 MB to 38 MB, reduced worst‑case GC pauses from seconds to sub‑second, and improved cache hit rates with a recency‑based eviction policy.
- Lowering the GC trigger floor (from 24 MiB to as low as needed) dramatically reduces resident memory without hurting throughput.
- Parallel marking (four markers) cuts long GC pauses from >2 s to <1 s, still far from Go’s ~20 ms but a clear target.
- Mutator‑assisted marking lets allocating threads help the collector, avoiding idle stalls.
- Implementing true weak, soft, and strong reference semantics enables a ranked‑retention cache that outperforms bulk‑flush approaches.
For AOT Java runtimes (and any closed‑world VM), GC pause latency and memory footprint directly affect UI responsiveness on mobile devices. ParparVM’s experiments show concrete knobs—trigger floor, parallelism, and reference policies—that can be tuned without changing Java code, offering a path to…
7/10

