Nofl: A Precise Immix
Andy Wingo
TL;DR
This work addresses memory management design by pursuing precise reclamation even at fine granularity, extending Immix with a side-table metadata approach to reclaim memory down to the allocator’s minimum alignment. It introduces Nofl, a precise Immix variant, and the Whippet library with a mostly-marking Nofl collector (mmc), plus the Whiffle Scheme-to-C workbench for evaluation. Across microbenchmarks, mmc generally yields lower wall-clock overhead than standard copying and mark-sweep collectors on tight heaps, though some benchmarks (e.g., earley) remain challenging, highlighting the trade-offs of finer-grained reclamation. The results suggest that precise, per-granule reclamation is feasible and can improve fragmentation behavior and overall performance in embedded runtimes, motivating broader production evaluations and future optimization directions.
Abstract
Can a memory manager be built with fast bump-pointer allocation, single-pass heap tracing, and a low upper bound on memory overhead? The Immix collector answered in the affirmative for the first two, but the granularity at which it reclaims memory means that in the worst case a tiny object can keep two 128-byte lines of memory from being re-used for allocation. This paper takes Immix to an extreme of precision, allowing all free space between objects to be reclaimed, down to the limit of the allocator's minimum alignment. We present the design of this Nofl layout, build a collector library around it, and build a new Scheme-to-C compiler as a workbench. We make a first evaluation of the Nofl-based mostly-marking collector when compared to standard copying and mark-sweep collectors and run against a limited set of microbenchmarks, finding that Nofl outperforms the others for tight-to-adequate heap sizes.
