一句话:提出首个容错且可回收循环垃圾的 actor 垃圾收集器 CRGC,并在 Pekko 中实现与评估。
Actor 框架要求程序员显式杀死 actor 来释放资源。已有 actor 垃圾收集器(GC)要么无法回收循环垃圾,要么在丢消息或节点崩溃时不再容错,难以用于不可靠分布式系统。本文提出 CRGC,首个容错的循环 actor GC。它让 actor 与节点本地记录信息并向各节点 GC 广播更新;无需锁、内存屏障或消息顺序假设,仅依赖 actor 到本地 GC 的可靠 FIFO 通道。作者给出操作语义并在 TLA+ 中形式化,证明可靠性(非垃圾 actor 永不被杀)与完备性(合理假设下所有垃圾 actor 最终被杀)。在 Apache Pekko 中的初步实现和两个基准套件显示,其开销与加权引用计数等简单方法相当,但能力更强。
Actors are lightweight reactive processes that communicate by asynchronous message-passing. Actors address common problems like concurrency control and fault tolerance, but resource management remains challenging: in all four of the most popular actor frameworks (Pekko, Akka, Erlang, and Elixir) programmers must explicitly kill actors to free up resources. To simplify resource management, researchers have devised actor garbage collectors (actor GCs) that monitor the application and detect when actors are safe to kill. However, existing actor GCs are impractical for distributed systems where the network is unreliable and nodes can fail. The simplest actor GCs do not collect cyclic garbage, whereas more sophisticated actor GCs are not fault-recovering : dropped messages and crashed nodes can cause actors to become garbage that never gets collected. We present Conflict-free Replicated Garbage Collection (CRGC): the first fault-recovering cyclic actor GC. In CRGC, actors and nodes record information locally and broadcast updates to the garbage collectors running on each node. CRGC does not require locks, explicit memory barriers, or any assumptions about message delivery order, except for reliable FIFO channels from actors to their local garbage collector. Moreover, CRGC is simple: we concisely present its operational semantics, which has been formalized in TLA + , and prove both soundness (non-garbage actors are never killed) and completeness (all garbage actors are eventually killed, under reasonable assumptions). We also present a preliminary implementation in Apache Pekko and measure its performance using two actor benchmark suites. Our results show the performance overhead of CRGC is competitive with simpler approaches like weighted reference counting, while also being much more powerful.
@article{paperbot3129,
title = {CRGC: Fault-Recovering Actor Garbage Collection in Pekko},
author = {Dan Plyukhin and Gul Agha and Fabrizio Montesi},
journal = {Proceedings of the ACM on Programming Languages},
volume = {9},
number = {PLDI},
year = {2025},
doi = {10.1145/3729288}
}