This page contains notes and ideas on improving glibc malloc performance.
jemalloc is an allocator that was developed for FreeBSD but is now used by other BSDs, Mozilla and Facebook. It is claimed to be significantly faster than the glibc malloc implementation on multi-threaded workloads.
The license is BSD-derived so is unlikely to be suitable as a drop-in replacement for the glibc malloc.
tcmalloc is an allocator that has been developed by Google. It also claims ot be significantly faster than the current glibc code.
tcmalloc does not return memory to the system, and the code is C++ and BSD licensed so is unlikely to be suitable as a drop-in replacement for the glibc malloc.
TLSF is an allocator designed for real time systems with constant time overhead. It is GPL/LGPL licensed.
Hoard is an allocator specifically designed for multi-processor systems. It can be used by the Intel compilers for SPEC benchmark builds. It's performance does not seem as good as jemalloc, tcmalloc and others. The code is in C++ and licensed either GPL or commercially.
nedmalloc claims to have performance similar to jemalloc. Licensed under the Boost license.
Streamflow is a mostly lockless allocator that keeps per-thread free lists rather than using multiple arenas and allocating threads to them. Code is LGPL licensed and on github.
SFMalloc is a lockless allocator with per-thread free lists.
SSMalloc is a mostly lockless allocator with per-thread free lists. It claims better performance than Streamflow or SFMalloc. Code is BSD licensed and on github.
The glibc wiki contains a list of enhancement ideas for the malloc implementation.
Various real world workloads are known to be sensitive to malloc implementation, these include:
- MySQL / MariaDB
WorkingGroups/ToolChain/LibraryPerformance/GlibcPerformance/GlibcMalloc (last modified 2014-03-25 15:20:09)