A high-performance message-passing memory allocator designed for scalable multithreaded applications.
snmalloc is a high-performance memory allocator designed for modern multithreaded applications. It uses a novel message-passing scheme to efficiently handle memory deallocations across threads, solving performance bottlenecks that occur when allocations are freed by different threads or in large batches.
System programmers and developers building high-performance multithreaded applications in C++ or Rust who need scalable memory allocation with minimal contention.
Developers choose snmalloc for its exceptional scalability across thousands of cores, lock-free remote deallocation via message passing, and optimized fast paths that outperform traditional allocators in challenging multithreaded scenarios.
Message passing based allocator
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a novel message-passing scheme to handle cross-thread frees without locks, enabling efficient scaling across thousands of cores as highlighted in the README.
Allocations and same-thread frees avoid synchronization, with only two branches on the malloc fast path, ensuring low-latency for common operations.
Employs large page ranges to minimize metadata requirements, reducing memory usage compared to traditional allocators.
Includes randomization, guard pages, and corruption detection in the hardened version, making it suitable for security-sensitive applications.
The hardened version adds randomization and guard pages, which introduce measurable performance overhead, making it less ideal for raw speed-critical applications.
Requires setup as a header-only library or LD_PRELOAD, which can be more involved than using standard system allocators, especially for beginners.
Compared to allocators like jemalloc or tcmalloc, snmalloc has a smaller community and fewer debugging tools, which might affect long-term support.