Papers for

java runtime engineers

Papers whose findings have a practical use for this group, as judged from the abstract. Open a paper to read what it means in practice.

Opportunistic garbage collection lowers heap size using idle CPU cores

Opportunistic ZGC: Leveraging Idle Cores for More Effective Concurrent Garbage Collection

Abstract: Managed language runtimes often provide concurrent garbage collectors so that latency-critical applications with large working sets can keep running while most collection work proceeds in the background. ZGC is a production-quality, generational, concurrent collector in OpenJDK with sub-millisecond pause times. While ZGC is designed to run concurrently, frequent and excessive collections with ZGC can still slow the mutators due to synchronization costs and interference with shared computing resources. Hence, the ZGC scheduler is conservative by default, and in most cases, will grow the heap toward the maximum allowed before scheduling a collection. While this approach minimizes collection effort, it can be wasteful, or even harmful, if the maximum heap size is not well tuned to the actual working set. We propose Opportunistic ZGC (OppZGC), a feedback-directed ZGC scheduling policy that constrains the heap dynamically and automatically, without per-application tuning. OppZGC identifies periods when CPU cores are underutilized and leverages them for concurrent collection with ZGC. We describe the design and implementation of OppZGC in OpenJDK's HotSpot Java VM and evaluate it with standard and latency-sensitive benchmarks from DaCapo Chopin and SPECjbb. OppZGC limits heap usage when there is CPU capacity sufficient for additional collections, and avoids scheduling extra collections when they would substantially degrade performance. Overall, it reduces maximum heap usage for our DaCapo benchmarks by between 61% and 90%, on average, depending on configuration, with minimal impact on throughput and request latency compared to default ZGC.

Mon 14 SeptProgramming LanguagesDistributed, Parallel, and Cluster ComputingPerformance
The gist
Many programs that use automatic memory management rely on garbage collectors to clean up unused data without stopping the program. The ZGC collector aims to do this with very short pauses, but it avoids running too often because frequent collections can slow down the program. The authors created Opportunistic ZGC, which safely runs extra garbage collections when CPU cores are idle. This approach reduces how much memory the program uses without hurting speed or causing delays.
Open 2609.15558v1