Overview of mimalloc design and features
main3mimalloc is a high-performance, general-purpose allocator designed for low latency and scalability. Key design features include:
- Free list sharding: Uses many small free lists per "mimalloc page" (typically 64KiB) to reduce fragmentation and improve locality.
- Free list multi-sharding: Implements multiple free lists per page (one for thread-local
freeoperations and one for concurrentfreeoperations) to minimize contention. - Eager page purging: Marks empty pages as unused to the OS to reduce memory pressure.
- Secure mode: Can be built with guard pages, randomized allocation, and encrypted free lists to protect against heap vulnerabilities.
- First-class heaps: Allows efficient creation of multiple heaps. In v3, these are true first-class heaps that can be allocated from any thread.
- Bounded performance: Provides bounded worst-case allocation times and low space overhead (~0.2% metadata).