Microsoft Research's mimalloc: A drop-in malloc replacement for concurrent apps
12K lines of C, 12K GitHub stars, powers Bing and CPython 3.13+.
Microsoft Research's RiSE group released mimalloc, a modern, scalable memory allocator built for concurrency and large-scale services. Originally designed in 2020 for the Lean and Koka programming languages, it has become a drop-in replacement for malloc/free across many platforms. The allocator uses thread-local heaps (theaps) to avoid synchronization on most allocations, with a fast path for small objects (<1 KiB) that requires no atomic operations. Its compact ~12K lines of C emphasize clear data structures and strong invariants, making it easier to reason about than industry alternatives like tcmalloc or jemalloc.
mimalloc has seen broad adoption: it serves as the concurrent allocator for NoGIL CPython 3.13+, is integrated into Unreal Engine, and powers games like Death Stranding. At Microsoft, it improved response times in Bing's services. The project has over 12K GitHub stars, and its Rust wrapper alone sees 100K+ downloads per day. It supports Windows, macOS, Linux, FreeBSD, NetBSD, DragonFly, and various consoles. The design also enables straightforward cyclic garbage collection. By providing bounded worst-case allocation times and minimal contention, mimalloc is effective from small-scale apps to services with 500+ GiB memory and hundreds of threads.
- Drop-in malloc/free replacement with thread-local heaps for lock-free allocation on small objects (< 1 KiB).
- Used in production at Microsoft (Bing), NoGIL CPython 3.13, Unreal Engine, and Death Stranding.
- Open-source, ~12K lines of C, 12K+ GitHub stars, Rust wrapper at 100K+ daily downloads.
Why It Matters
A battle-tested, open-source allocator that boosts performance in concurrent and large-memory workloads without changing code.