推荐yvdriess · 2026-02
“There is a good write-up of the problem and a way to estimate the cost based on different GC strategies, as you suggested, here: Distilling the Real Cost of Production Garbage Collectors”
推荐它:讲清 GC 开销,并给出按不同 GC 策略估算成本的方法
提出“蒸馏”法估算垃圾回收的真实成本,评测 OpenJDK 17 的五种 GC
论文提出一种方法,可针对任意一组指标经验性地估计垃圾回收(GC)的成本:先剔除可明确识别的 GC 成本,得到应用本身的执行成本作为基线,再用总成本减去基线,得到各 GC 成本的经验下界。作者据此研究了 OpenJDK 17 中的五种生产级 GC,发现在适中堆大小下,它们的额外开销是 7–82% 的挂钟时间和 6–92% 的 CPU 周期,较新的低暂停 GC 比旧 GC 明显更贵,有时延迟甚至不如 stop-the-world GC。结论是 GC 远非已解决的问题,并建议未来评估采用该方法和更丰富的成本指标。
评论者用它来量化“GC 到底有多贵”:给出一种按不同 GC 策略估算成本的方法,并说明 GC 的真实成本隐蔽、难以测量。
“There is a good write-up of the problem and a way to estimate the cost based on different GC strategies, as you suggested, here: Distilling the Real Cost of Production Garbage Collectors”
“True GC costs are simply more hidden and harder to measure.”