Oriel — AI & technology worth noticing, every day.

The state of Rust allocators in 2026: stabilised

Web page · https://cetra3.github.io/blog/state-of-allocators-2026-finally-stabilised

First seen by Oriel on .

AI summary

The article surveys practical uses of Rust’s newly stabilised allocator API: bulk reclamation, memory accounting, and control over allocation location and alignment.

  • A bump allocator serves bursty workloads such as web requests by making allocation cheap and releasing a whole arena at once, though individual deallocations are no-ops.
  • Wrapping an allocator with accounting can track memory for caches, external sorts, or sandboxes; the example uses an atomic counter for allocated bytes.
  • The thresher crate batches accounting across local and global counters, reports thresholds, and is used to trigger heap profiles for Rust services.
  • Custom allocators can provide stack-first storage with heap spillover or stronger alignment for O_DIRECT reads; allocator-generic Vec APIs let code share methods across strategies.
  • The allocator API is an MVP, and ecosystem adoption is limited by crate MSRV policies; support for other collection types remains unfinished.

#rust #memory allocation #allocator api #linux

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Hacker News: 217, latest observation ; +209 over observed period since
  • Lobsters: 68, latest observation ; +67 over observed period since

Comments

Comment count reported by the source.

  • Hacker News: 90, latest observation ; +90 over observed period since
  • Lobsters: 2, latest observation ; +2 over observed period since

Aliases

SourceExternal IDURL
Hacker News50676130https://cetra3.github.io/blog/state-of-allocators-2026-finally-stabilised/ Read discussion
Lobstersu746hshttps://cetra3.github.io/blog/state-of-allocators-2026-finally-stabilised/ Read discussion