低延迟、高吞吐量的垃圾回收(扩展版)
Low-Latency, High-Throughput Garbage Collection (Extended Version)
摘要:
生产垃圾收集器在追求减少暂停时间方面做出了实质性的妥协。它们需要比以前更简单的收集器多得多的CPU周期和内存。并发复制收集器(C4、ZGC和Shenandoah)受到以下设计限制。1)同时复制。它们仅通过复制来回收内存,这本身就很昂贵,并且内存带宽要求很高。并发复制还需要昂贵的读写屏障。2)可扩展性。它们依赖于追踪,而追踪在极限和实践中是不成比例的。3)即时性。它们不会立即回收较旧的对象,从而导致较高的内存开销。我们提出了LXR,它采用了一种非常不同的方法,通过最大限度地减少并发收集工作和开销来优化响应能力和吞吐量。1)LXR通过使用Immix堆结构回收大部分内存而不进行任何复制。然后,它通过有限的明智的停止世界复制来对抗碎片化。2)LXR使用引用计数来实现可伸缩性和即时性,及时回收年轻和旧对象。它根据需要使用并发跟踪来识别循环垃圾。3)为了最小化暂停时间,同时允许明智地复制成熟对象,LXR引入了用于引用计数和并发递减处理的记忆集。4)LXR引入了一种新颖的低开销写屏障,它结合了合并引用计数、并发跟踪和记忆集维护。其结果是收集器具有出色的响应性和吞吐量。在广泛使用的Lucene搜索引擎上,LXR具有6倍的吞吐量,同时提供比流行的Shenandoah生产收集器低30倍的99.9%尾部延迟。
英文摘要:
Production garbage collectors make substantial compromises in pursuit of reduced pause times. They require far more CPU cycles and memory than prior simpler collectors. concurrent copying collectors (C4, ZGC, and Shenandoah) suffer from the following design limitations. 1) Concurrent copying. They only reclaim memory by copying, which is inherently expensive with high memory bandwidth demands. Concurrent copying also requires expensive read and write barriers. 2) Scalability. They depend on tracing, which in the limit and in practice does not scale. 3) Immediacy. They do not reclaim older objects promptly, incurring high memory overheads. We present LXR, which takes a very different approach to optimizing responsiveness and throughput by minimizing concurrent collection work and overheads. 1) LXR reclaims most memory without any copying by using the Immix heap structure. It then combats fragmentation with limited judicious stop-the-world copying. 2) LXR uses reference counting to achieve both scalability and immediacy, promptly reclaiming young and old objects. It uses concurrent tracing as needed for identifying cyclic garbage. 3) To minimize pause times while allowing judicious copying of mature objects, LXR introduces remembered sets for reference counting and concurrent decrement processing. 4) LXR introduces a novel low-overhead write barrier that combines coalescing reference counting, concurrent tracing, and remembered set maintenance. The result is a collector with excellent responsiveness and throughput. On the widely-used Lucene search engine with a generously sized heap, LXR has 6x higher throughput while delivering 30x lower 99.9 percentile tail latency than the popular Shenandoah production collector in its default configuration.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。