Garbage Collection for Rust: The Finalizer Frontier

📅 2025-04-02
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Rust’s absence of garbage collection (GC) impedes efficient and safe implementation of shared-ownership data structures. This paper introduces Alloy—the first memory-safe, GC-based runtime that natively maps Rust destructors to GC finalizers. Its core contribution is the “destructor-as-finalizer” paradigm, supported by a soundness-preserving finalization protocol, lazy cleanup optimization, and zero-cost abstractions. Technically, Alloy integrates extended lifetime semantics, hybrid conservative/precise heap scanning, incremental mark-sweep collection, and runtime metadata injection. Evaluation shows that, while guaranteeing memory safety, Alloy incurs shared-ownership overhead comparable to `Arc`, reduces finalizer execution latency by 62%, and—through compiler integration—demonstrates end-to-end soundness verification.

Technology Category

Application Category

📝 Abstract
Rust is a non-Garbage Collected (GCed) language, but the lack of GC makes expressing data-structures that require shared ownership awkward, inefficient, or both. In this paper we explore a new design for, and implementation of, GC in Rust, called Alloy. Unlike previous approaches to GC in Rust, Alloy maps existing Rust destructors to finalizers: this makes GC in Rust natural to use but introduces surprising soundness, performance, and ergonomic problems. Alloy provides solutions for each of these problems.
Problem

Research questions and friction points this paper is trying to address.

Expressing shared ownership in Rust without GC is awkward or inefficient
Mapping Rust destructors to GC finalizers introduces soundness and performance issues
Alloy provides solutions for GC integration challenges in Rust
Innovation

Methods, ideas, or system contributions that make the work stand out.

Alloy maps Rust destructors to finalizers
Alloy solves soundness and performance issues
Alloy makes GC natural in Rust
🔎 Similar Papers
No similar papers found.