paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Optimal Choice of When to Garbage Collect

垃圾回收(GC)时机的最优选择
TOPLAS 41(1)2019匹配度 2/10 · 该论文属于程序语言与运行时/内存管理中的形式化优化问题,使用动态规划优化 GC 调度,但未涉及用户核心关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析,也缺乏与 LLM/Agent 的交叉。引用 5 inbox
Nicholas Jacek, Meng-Chieh Chiu, Benjamin M. Marlin, J. Eliot B. Moss
crossref: 2026-09-10

AI 速览

一句话:将程序特定的 GC 调度形式化为优化问题,用动态规划求非分代与分代 GC 的最优回收时机。

论文研究程序特定的垃圾回收(GC)性能极限,关注给定程序运行与堆空间下如何最优选择回收时机。作者将 GC 调度刻画为优化问题,针对非分代收集器给出线性时间的动态规划最优调度算法。为处理分代 GC,他们分析堆对象图以计算对象的 pre-birth time,把非分代调度推广到两代情形,得到代价随 trace 长度二次增长的动态规划解,并进一步推广到多代。实验在 DaCapo Java 程序 trace 上评估两代情形,表明程序特定回收策略可降低 GC 开销:固定空间预算下常节省少量但有用的时间,固定时间预算下可节省可观空间。

问题
在给定程序运行与堆空间约束下,如何为具体程序选择最优的垃圾回收时机,并将非分代 GC 的最优调度推广到分代 GC。
方法
将 GC 调度形式化为优化问题,利用堆对象图分析计算对象的 pre-birth time;对非分代收集器给出线性时间动态规划,对两代及多代收集器给出代价随 trace 长度二次增长的动态规划。
评估
在 DaCapo Java 程序 trace 上对两代情形进行实验,比较最优调度在固定空间或时间预算下的时间与空间节省。
原文摘要(Abstract)

We consider the ultimate limits of program-specific garbage collector (GC) performance for real programs. We first characterize the GC schedule optimization problem. Based on this characterization, we develop a linear-time dynamic programming solution that, given a program run and heap size, computes an optimal schedule of collections for a non-generational collector. Using an analysis of a heap object graph of the program, we compute a property of heap objects that we call their pre-birth time. This information enables us to extend the non-generational GC schedule problem to the generational GC case in a way that also admits a dynamic programming solution with cost quadratic in the length of the trace (number of objects allocated). This improves our previously reported approximately optimal result. We further extend the two-generation dynamic program to any number of generations, allowing other generalizations as well. Our experimental results for two generations on traces from Java programs of the DaCapo benchmark suite show that there is considerable promise to reduce garbage collection costs for some programs by developing program-specific collection policies. For a given space budget, optimal schedules often obtain modest but useful time savings, and for a given time budget, optimal schedules can obtain considerable space savings.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot718,
  title = {Optimal Choice of When to Garbage Collect},
  author = {Nicholas Jacek and Meng-Chieh Chiu and Benjamin M. Marlin and J. Eliot B. Moss},
  journal = {ACM Transactions on Programming Languages and Systems},
  volume = {41},
  number = {1},
  year = {2019},
  doi = {10.1145/3282438}
}