2025-07-25 –, Main Room 1 (Main stage)
Julia's mark-sweep GC poses some challenges to heap-intensive workloads like RelationalAI's cloud application, such as fragmentation and long pauses. The runtime's tight coupling with the GC prevents the adoption of new collectors. We introduced a GC interface to decouple the runtime from the GC, and integrated MMTk as one new alternative collector. MMTk provides cutting-edge GC algorithms, and allows community-driven innovation. We present preliminary results from using MMTk in RAI's workloads.
Julia’s garbage collector has served the language well for the typical high-performance computing (HPC) applications it was originally designed for.
As Julia evolves and expands into more diverse domains—such as cloud computing—the garbage collector faces new challenges. Although the built-in mark-sweep collector is straightforward and performs sufficiently well for throughput-oriented workloads, it struggles with memory-intensive applications with tight latency constraints. Unpredictable stop-the-world pauses disrupt latency-sensitive tasks, while the inability to move objects leads to fragmentation, which, in turn, leads to poor memory utilization for long-running workloads. We encounter both issues with Julia’s built-in collector at RelationalAI.
Compounding these issues, years of incremental evolution have embedded GC-specific constraints deep into the runtime. For example, the runtime assumes that heap objects never move, making direct access to objects pervasive. This immovability blocks optimizations like heap compaction, further limiting the collector’s capability and complicating the adoption of more advanced collectors.
To overcome these challenges, we have rearchitected Julia’s GC subsystem into a modular interface that decouples the runtime from any specific collector. This refactoring requires untangling years-old assumptions—such as object movability, root management, and generational behaviors—while preserving Julia’s existing flexibility and semantics. The result is a framework that empowers the community to experiment with diverse GC implementations, ensuring Julia can adapt to evolving memory management needs.
Central to this effort is our integration of MMTk, a high-performance, cross-language GC framework. We have added support for multiple collectors from MMTk, including one of its generational collectors (Sticky Immix) with support for opportunistic copying, demonstrating that Julia’s refactored interface can support collectors far beyond the capability of the built-in mark-sweep. Early results show improvements in allocation and collection throughput, as well as reductions in memory fragmentation, both on open-source micro-benchmarks and on large-scale customer benchmarks, where we have begun experimentally testing MMTk at RelationalAI.
More interestingly, MMTk is a suite of diverse garbage collection algorithms that supports multiple language implementations. Its active development ecosystem opens doors to cutting-edge algorithms like LXR low-latency GC and other innovations. By integrating MMTk, Julia not only future-proofs its memory management but also joins a cross-language effort to advance GC innovation—where improvements in one language benefit all.
TODO.