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

📅 2026-09-14
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
针对ZGC在并发垃圾收集时可能引起的性能问题,提出Opportunistic ZGC方法,利用空闲CPU核心进行更有效的并发垃圾收集,减少堆内存使用。
📝 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.
Problem

Research questions and friction points this paper is trying to address.

concurrent garbage collection
synchronization costs
heap usage
Innovation

Methods, ideas, or system contributions that make the work stand out.

Opportunistic ZGC
feedback-directed scheduling
concurrent garbage collection
dynamic heap constraint
🔎 Similar Papers
No similar papers found.