The state of Rust allocators in 2026: stabilised
Rust 1.100 has stabilized custom allocators, enabling developers to use custom memory strategies like bump, accounted, stack-first, and block-aligned allocation generically across standard collections.
read it It provides concrete, working code examples for implementing and leveraging Rust's newly stabilized custom allocator API.
summary
Rust has officially stabilized the MVP of its custom allocator API after years of development. The article demonstrates practical use cases including bump allocators for request burst handling, accounting wrappers for memory tracking, stack-first fallbacks, and block-aligned allocations for direct I/O. These patterns allow developers to tune performance and memory behavior locally while maintaining generic collection compatibility. While ecosystem adoption will take time, this brings powerful low-level control to stable Rust.
key points
- Bump allocators batch deallocations by reserving a large block of memory and resetting a single counter, drastically reducing overhead for burst-allocation workloads like web requests.
- Accounted allocators wrap existing allocation strategies to track memory usage dynamically and trigger callbacks when thresholds are crossed.
- The stabilization allows collections like Vec to be generic over custom allocators without requiring separate dedicated types like smallvec or aligned-vec.
who should read it
Systems programmers and Rust developers looking to optimize memory management and performance-critical subsystems.
discussion positive
consensus
Commenters generally celebrate the stabilization as a major milestone for low-level Rust, though many debate whether explicit allocators add unnecessary ergonomic friction or code bloat compared to global or implicit approaches.
pushback
Some users point out that Rust lacks thread-local or implicit allocator contexts, meaning developers must manually thread `.new_in()` through every function, unlike language features found in Zig or runtime wrappers like jemalloc.
I use Jemalloc in a specific project because it keeps per-thread allocation counters, so I can both monitor how much memory a thread is actively using (and how much it has allocated and deallocated), and I can limit it.
This is an incredible feature, and it's a hard requirement for this particular project, and a good fit because the workloads map to threads. Manually managing such counters with the standard Rust allocator is not a practical option.
But one problem I see with the new Rust allocators is that it doesn't seem like there's any kind of thread-local allocator? If so, you have to …
It highlights a major ergonomic pain point with the new API: the lack of implicit thread-local context requiring explicit passing of allocators throughout a subsystem.
Generated by an LLM from the article and thread. Check the sources before relying on it.