paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Collecting Cyclic Garbage across Foreign Function Interfaces: Who Takes the Last Piece of Cake?

跨外部函数接口(FFI)回收循环垃圾:谁拿走最后一块蛋糕?
PLDI 7(PLDI)2023匹配度 2/10 · 该论文属于程序语言与运行时/内存管理方向,研究跨 FFI 的循环垃圾回收算法;但用户关注的是 PL 与 AI/LLM 的交叉、静态分析、浮点程序分析和贝叶斯程序分析,本文并未涉及这些核心主题,因此匹配度较低。引用 1 inbox
Tetsuro Yamazaki, Tomoki Nakamaru, Ryota Shioya, Tomoharu Ugawa, Shigeru Chiba
crossref: 2026-09-10

AI 速览

一句话:提出 Refgraph GC,跨 FFI 回收两个托管语言间的循环垃圾,且只需修改一方运行时。

跨托管语言的 FFI 日益常见,但用户级库实现的 FFI 无法回收跨语言边界的循环垃圾,即一组通过循环引用相互持有的对象。本文提出 Refgraph GC,通过协调两种语言的垃圾收集器来回收此类循环垃圾;它只需修改其中一种语言的托管运行时,而无需修改另一种语言。文章论证了该算法的可靠性与完备性,并实现了一个让 Ruby 程序访问 JavaScript 库的 FFI 进行实验。实验展示了该方案在实际 FFI 中跨语言回收循环垃圾的可行性,并对双方运行时保持最小侵入。

问题
研究问题是:在两个托管语言之间通过 FFI 互操作时,如何回收跨语言边界形成的循环垃圾;现有用户级库实现因双方垃圾收集器彼此独立而无法处理。
方法
提出 Refgraph GC,协调两个语言的垃圾收集器,并且仅需修改其中一种语言的托管运行时;论文给出算法并分析其可靠性与完备性。
评估
作者用 Ruby 程序访问 JavaScript 库的 FFI 实现进行实验,展示该方法可跨语言边界回收循环垃圾。
原文摘要(Abstract)

A growing number of libraries written in managed languages, such as Python and JavaScript, are bringing about new demand for a foreign language interface (FFI) between two managed languages. Such an FFI allows a host-language program to seamlessly call a library function written in a foreign language and exchange objects. It is often implemented by a user-level library but such implementation cannot reclaim cyclic garbage, or a group of objects with circular references, across the language boundary. This paper proposes Refgraph GC , which enables FFI implementation that can reclaim cyclic garbage. Refgraph GC coordinates the garbage collectors of two languages and it needs to modify the managed runtime of one language only. It does not modify that of the other language. This paper discusses the soundness and completeness of the proposed algorithm and also shows the results of the experiments with our implementation of FFI with Refgraph GC. This FFI allows a Ruby program to access a JavaScript library.

链接与引用

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

BibTeX
@article{paperbot2013,
  title = {Collecting Cyclic Garbage across Foreign Function Interfaces: Who Takes the Last Piece of Cake?},
  author = {Tetsuro Yamazaki and Tomoki Nakamaru and Ryota Shioya and Tomoharu Ugawa and Shigeru Chiba},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {PLDI},
  year = {2023},
  doi = {10.1145/3591244}
}