Jadwal Sholat

Memuat jadwal sholatโ€ฆ

Ilmu Komputer & AI editorial

Open AccessOA2026

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

A feedback-directed scheduling policy that dynamically constrains heap usage by exploiting underutilized CPU cores for concurrent collection in OpenJDK's HotSpot JVM
Jacob Malloy; Michael R. Jantz; Terry Jonesยท 2026ยท DOI 10.48550/arXiv.2609.15558

The core problem

Managed language runtimes increasingly rely on concurrent garbage collectors to support latency-critical applications with large working sets. ZGC, a production-quality generational concurrent collector in OpenJDK, achieves sub-millisecond pause times by performing most collection work in the background alongside mutator threads. However, concurrent collection is not free: frequent or excessive collections can slow mutators due to synchronization costs and interference over shared computing resources such as memory bandwidth and cache. Consequently, the default ZGC scheduler is conservative, typically growing the heap toward its maximum allowed size before scheduling a collection. While this minimizes collection effort, it can be wasteful or even harmful when the maximum heap size is poorly tuned to the actual working set. The authors propose Opportunistic ZGC (OppZGC), a feedback-directed scheduling policy that dynamically and automatically constrains the heap without per-application tuning. OppZGC identifies periods when CPU cores are underutilized and leverages them for concurrent collection, aiming to reduce heap footprint while preserving throughput and latency. The work is im

Innovation

Experimental results show that OppZGC reduces maximum heap usage for DaCapo benchmarks by between 61% and 90%, on average, depending on configuration, compared to default ZGC. This substantial reduction is achieved with minimal impact on throughput and request latency. The policy successfully identifies periods of CPU underutilization and uses them for concurrent collection, effectively trading spare CPU cycles for lower memory footprint. For latency-sensitive workloads, OppZGC avoids scheduling extra collections when they would substantially degrade performance, preserving the sub-millisecond pause times that ZGC is known for. The evaluation across DaCapo Chopin and SPECjbb benchmarks demonstrates that the feedback-directed approach can automatically adapt to varying working sets without per-application tuning. The range of heap reduction (61โ€“90%) reflects different configurations and benchmark characteristics, indicating that the benefits are robust but configuration-dependent. Overall, the results suggest that opportunistic collection can significantly reduce memory pressure in managed runtimes while maintaining the performance guarantees expected from a production concurrent co
Managed language runtimes increasingly rely on concurrent garbage collectors to support latency-critical applications with large working sets. ZGC, a production-quality generational concurrent collector in OpenJDK, achieves sub-millisecond pause times by performing most collection work in the background alongside mutator threads. However, concurrent collection is not free: frequent or excessive collections can slow mutators due to synchronization costs and interference over shared computing resources such as memory bandwidth and cache. Consequently, the default ZGC scheduler is conservative, typically growing the heap toward its maximum allowed size before scheduling a collection. While this minimizes collection effort, it can be wasteful or even harmful when the maximum heap size is poorly tuned to the actual working set. The authors propose Opportunistic ZGC (OppZGC), a feedback-directed scheduling policy that dynamically and automatically constrains the heap without per-application tuning. OppZGC identifies periods when CPU cores are underutilized and leverages them for concurrent collection, aiming to reduce heap footprint while preserving throughput and latency. The work is implemented in OpenJDK's HotSpot Java VM and evaluated with standard and latency-sensitive benchmarks from DaCapo Chopin and SPECjbb.
OppZGC operates as a feedback-directed scheduling policy integrated into HotSpot's ZGC. The core idea is to monitor CPU utilization and schedule additional concurrent collections only when spare CPU capacity exists, thereby using otherwise idle cores for collection work. The policy dynamically constrains the heap: when sufficient CPU capacity is available for extra collections, OppZGC limits heap growth; when additional collections would substantially degrade performance, it avoids scheduling them. This creates a closed-loop control system where heap size and collection frequency adapt to runtime conditions without manual tuning. The implementation is evaluated using standard and latency-sensitive benchmarks from DaCapo Chopin and SPECjbb, comparing OppZGC against default ZGC. Metrics include maximum heap usage, throughput, and request latency. The evaluation spans multiple configurations to assess the trade-offs introduced by opportunistic collection. Formally, the scheduling decision can be modeled as a feedback control problem where the controller observes CPU utilization and heap occupancy , and decides whether to trigger a collection when and , subject to a performance constraint that estimated mutator slowdown remains below an acceptable bound. The policy thus seeks to minimize heap usage while keeping throughput and latency within a small factor of default ZGC.

Why it matters

The key insight of OppZGC is that concurrent garbage collection need not be a background activity that competes with mutators; instead, it can be scheduled opportunistically during periods when CPU cores are underutilized. This transforms idle CPU capacity into a resource for reducing heap footprint, addressing the common problem of over-provisioned heaps that waste memory or cause unnecessary collection overhead. By automatically constraining the heap without per-application tuning, OppZGC reduces the burden on operators and developers who often struggle to size heaps correctly. The feedback-directed design ensures that the policy remains conservative when collection would harm performance, thus avoiding the pitfalls of aggressive collection. The 61โ€“90% reduction in maximum heap usage is significant for memory-constrained environments such as containers and cloud instances, where memory is a costly resource. However, the approach relies on the availability of idle CPU cores; in CPU-saturated environments, the opportunities for opportunistic collection may be limited. Future work could explore extending the policy to consider other resources, such as memory bandwidth, and to integrate with other concurrent collectors. The implementation in HotSpot demonstrates the practicality of the approach, and the evaluation provides a strong foundation for further research into feedback-directed memory management. The architecture of OppZGC can be visualized as follows:

This control loop continuously adapts to runtime conditions, balancing heap usage against performance impact.

Who should read this

CS practitioners and researchers

Opening member contentโ€ฆ