A public domain, cross-platform, lock-free thread caching memory allocator with 16-byte alignment, implemented in C.
rpmalloc is a high-performance, lock-free memory allocator implemented in C. It solves the problem of memory allocation contention in multithreaded applications by providing per-thread caches and 16-byte aligned allocations. It's designed to be faster than popular alternatives like tcmalloc, hoard, and ptmalloc3 while maintaining low memory overhead.
System programmers, game developers, and embedded engineers building performance-critical multithreaded applications in C or C++ that require efficient memory management.
Developers choose rpmalloc for its combination of lock-free design, cross-platform compatibility, and superior performance metrics. Its single-file implementation and public domain/MIT licensing make it exceptionally easy to integrate and modify compared to more complex allocators.
Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C
Each thread has its own heap and cache, eliminating locks and minimizing contention in multithreaded environments, as highlighted in the README for high-performance applications.
Implemented in a single ~2200-line C source file, making it easier to read, modify, and integrate compared to complex allocators like tcmalloc or hoard.
All allocations are naturally 16-byte aligned, which is ideal for SIMD instructions and modern CPU architectures without extra overhead.
Supports Windows, Linux, macOS, iOS, and Android with configurable memory mapping backends, including huge page support for reduced TLB misses.
The library assumes valid inputs and does not guard against errors, such as passing invalid pointers to free, which can lead to segmentation faults or undefined behavior.
On POSIX systems, it oversizes memory mappings to ensure alignment, potentially wasting virtual address space, which is a caveat mentioned in the README.
In worst-case scenarios with many unfilled size classes, memory usage can be inefficient, requiring manual configuration tweaks that add complexity.
mimalloc is a compact general purpose allocator with excellent performance.
General purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. [BSD] website
TCMalloc is Google's customized implementation of C's `malloc()` and C++'s `operator new` for memory allocation within C and C++ code. It provides a high-performance alternative to standard memory allocators, optimized for multi-threaded applications where allocation speed and scalability are critical. ## Key Features - **Fast Allocation** — Optimized for speed with efficient memory management algorithms - **Multi-threaded Performance** — Designed to scale well in concurrent environments - **Customizable Configuration** — Tunable parameters for different workload requirements - **Comprehensive API** — Full support for C and C++ memory allocation interfaces - **Platform Support** — Available across multiple operating systems and architectures ## Philosophy TCMalloc prioritizes performance and scalability in multi-threaded environments while maintaining compatibility with standard memory allocation interfaces, making it suitable for production systems with demanding memory allocation patterns.
The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.