Abridged abstract: despite the long history of garbage collection (GC) and its prevalence in modern programming languages, there is surprisingly little clarity about its true cost. Without understanding their cost, crucial tradeoffs made by garbage collectors (GCs) go unnoticed. This can lead to misguided design constraints and evaluation criteria used by GC researchers and users, hindering the development of high-performance, low-cost GCs. In this paper, we develop a methodology that allows us to empirically estimate the cost of GC for any given set of metrics. By distilling out the explicitly identifiable GC cost, we estimate the intrinsic application execution cost using different GCs. The minimum distilled cost forms a baseline. Subtracting this baseline from the total execution costs, we can then place an empirical lower bound on the absolute costs of different GCs. Using this methodology, we study five production GCs in OpenJDK 17, a high-performance Java runtime. We measure the cost of these collectors, and expose their respective key performance tradeoffs. We find that with a modestly sized heap, production GCs incur substantial overheads across a diverse suite of modern benchmarks, spending at least 7-82% more wall-clock time and 6-92% more CPU cycles relative to the baseline cost. We show that these costs can be masked by concurrency and generous provisioning of memory/compute. In addition, we find that newer low-pause GCs are significantly more expensive than older GCs, and, surprisingly, sometimes deliver worse application latency than stop-the-world GCs. Our findings reaffirm that GC is by no means a solved problem and that a low-cost, low-latency GC remains elusive. We recommend adopting the distillation methodology together with a wider range of cost metrics for future GC evaluations.
翻译:缩略式抽象: 尽管垃圾收集(GC)的历史悠久,而且其在现代编程语言中的普及程度也相当广泛,但令人惊讶的是,其真实成本却鲜为明晰。在不理解其成本的情况下,垃圾收集者(GC)做出的关键权衡是无人注意的。这可能导致GC研究人员和用户使用错误的设计限制和评价标准,从而阻碍高性能、低成本的GC的开发。在本文件中,我们开发了一种方法,使我们能够根据经验估算任何特定指标的GC成本。通过蒸馏清楚的GC成本,我们用不同的GC来估算其内在的更低的应用程序执行成本。 最低蒸馏成本成本构成了一个基准。从总执行成本的总额中抽取这一基准,我们就可以对不同的GC的绝对成本进行更低的经验约束。 使用这种方法,我们在OpenJDK 17中研究五种高性能的GC,一个高性能的爪哇运行期。 我们测量这些收藏者的成本,并暴露了各自的关键绩效权衡。我们发现,由于规模较小, GC 其生产成本比C 692 高得多,我们有时会在不同的现代的代数级基准中,我们用一个比C 标准 花费最低成本 。