A compact, high-performance general-purpose memory allocator with excellent performance and security features.
mimalloc is a high-performance, general-purpose memory allocator designed as a drop-in replacement for standard malloc. It solves problems of fragmentation, contention, and unpredictable latency in multi-threaded applications by using innovative techniques like free list sharding and eager page purging.
System programmers, runtime developers, and engineers building low-latency services or languages (like Koka and Lean) who need a reliable, fast allocator with predictable behavior.
Developers choose mimalloc for its consistent performance across benchmarks, lower memory footprint compared to jemalloc and tcmalloc, security features, and simplicity—being only about 10k LOC while handling large-scale workloads.
mimalloc is a compact general purpose allocator with excellent performance.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Distributes free lists per mimalloc page to reduce fragmentation and improve locality, enhancing performance in multi-threaded applications as shown in benchmarks like larsonN.
Marks empty pages as unused to the OS, lowering memory pressure and fragmentation, which is crucial for long-running server programs and reduces real memory usage.
Includes guard pages, randomized allocation, and encrypted free lists to mitigate heap vulnerabilities, with only a ~10% performance penalty on average in benchmarks.
Ensures predictable allocation times and avoids blowup, providing consistent behavior across diverse workloads, as emphasized in the design philosophy.
Maintains three parallel versions (v1, v2, v3) with different memory handling, complicating version selection and support for users unfamiliar with the nuances.
Dynamic overriding on Windows requires specific steps like linking with mimalloc.dll.lib and ensuring correct DLL ordering, making setup more involved than on Unix-like systems.
Enabling secure mode for added protection incurs a consistent ~10% performance overhead, which may deter use in latency-sensitive applications despite the security benefits.
Placing OS guard pages in guarded mode can significantly increase memory usage (at least 8 KiB per guarded object) and system call frequency, impacting performance for high-frequency allocations.