Deconstructing the garbage-first collector

Deconstructing the garbage-first collector
复制标题

解构垃圾优先收集器

DOI:
10.1145/3381052.3381320
复制
发表时间:
2020
期刊:
Proceedings of the 16th ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments
影响因子:
--
通讯作者:
S. Blackburn
S. Blackburn
中科院分区:
--
文献类型:
--
作者:
Wenyu Zhao;S. Blackburn

文献摘要

被引文献

相似文献

Garbage-First是当今使用最广泛的垃圾收集器之一。它用于HotSpot和OpenJDK虚拟机,并与其他三个重要的当代收藏家:Shenandoah,C4和ZGC共享算法基础。然而,核心算法的设计和它们所表现出的性能权衡在文献中没有仔细分析。在这项工作中,我们解构了G1算法,并从第一原理重新实现它。我们回顾性地开发了一个并发的,基于区域的疏散收集器,CRE,它捕获了G1,Shenandoah,C4和ZGC共享的主要设计元素。然后,我们评估G1的每个主要元素对性能的影响,包括暂停时间,记忆集的足迹和障碍开销。我们发现,G1的并发标记和分代收集分别减少了64%和93%的95百分位GC暂停。我们发现,G1的记忆集的空间开销是非常低的,通常在1%以下。我们还独立测量了G1使用的障碍,发现它们相对于总性能的开销约为12%。这种分析为用户和收集器设计者提供了对垃圾优先收集器和其他基于固定大小区域的并发疏散收集器的见解,我们希望这将导致更好地使用收集器并促进未来的改进。
Garbage-First is among today's most widely used garbage collectors. It is used in the HotSpot and OpenJDK virtual machines, and shares algorithmic foundations with three other important contemporary collectors: Shenandoah, C4, and ZGC. However, the design of the core algorithms and the performance tradeoffs they manifest have not been carefully analyzed in the literature. In this work, we deconstruct the G1 algorithm and re-implement it from first principles. We retrospectively develop a concurrent, region-based evacuating collector, CRE, which captures the principal design elements shared by G1, Shenandoah, C4, and ZGC. We then evaluate the impact of each of the major elements of G1 on performance, including pause time, remembered set footprint and barrier overheads. We find that G1's concurrent marking and generational collection reduces the 95-percentile GC pauses by 64% and 93% respectively. We find that the space overhead of G1's remembered sets is very low, typically under 1%. We also independently measure the barriers used by G1 and find that they have an overhead of around 12% with respect to total performance. This analysis gives users and collector designers insights into the garbage-first collector and the other fixed-size region-based concurrent evacuating collectors, which we hope will lead to better use of the collectors and provoke future improvements.