Jemalloc
A high-performance general-purpose memory allocator that achieves low memory fragmentation and high concurrent allocation performance in multithreaded environments through an arena mechanism, thread-local caching (tcache), and fine-grained size class partitioning. It is widely used in production systems such as Meta, Redis, and Rust.
Timeline (last 90 days)
Jemalloc released version 5.4.0.
The release of Jemalloc 5.4.0 received 229 upvotes and 58 comments on Hacker News.
Jemalloc is a general-purpose memory allocator widely used in the industry, known for its low fragmentation rate and high concurrency performance in multi-threaded environments.
Jemalloc has long been relied upon by numerous projects including Facebook (Meta), Redis, and the Rust ecosystem.
Redis has long used jemalloc as its default allocator to handle the frequent allocation of massive numbers of small objects.
Jemalloc reduces memory fragmentation and improves allocation and deallocation throughput through its arena mechanism, thread-local cache (tcache), and fine-grained size class partitioning.
Jemalloc's arena mechanism divides the memory allocation space into multiple independent arenas, with each thread bound to a specific arena, thereby avoiding lock contention on a single lock during concurrent multi-threaded allocation.
tcache maintains a free list of small objects within each thread, making the vast majority of allocation and deallocation operations completely lock-free, with cross-thread synchronization triggered only when the tcache is exhausted or memory needs to be returned to an arena.
jemalloc has a better reputation for memory fragmentation control and memory footprint stability after long periods of operation, making it particularly suitable for server-side scenarios requiring long-term stable operation, such as databases.
Production environment users evaluating whether to upgrade to a new version must weigh performance gains against potential compatibility risks, and it is recommended to conduct thorough stress testing in a test environment before upgrading critical systems.
All Facts (9)
Production environment users evaluating whether to upgrade to a new version must weigh performance gains against potential compatibility risks, and it is recommended to conduct thorough stress testing in a test environment before upgrading critical systems.
50%UnverifiedJemalloc is a general-purpose memory allocator widely used in the industry, known for its low fragmentation rate and high concurrency performance in multi-threaded environments.
50%UnverifiedJemalloc has long been relied upon by numerous projects including Facebook (Meta), Redis, and the Rust ecosystem.
50%UnverifiedRedis has long used jemalloc as its default allocator to handle the frequent allocation of massive numbers of small objects.
50%UnverifiedJemalloc reduces memory fragmentation and improves allocation and deallocation throughput through its arena mechanism, thread-local cache (tcache), and fine-grained size class partitioning.
50%UnverifiedJemalloc's arena mechanism divides the memory allocation space into multiple independent arenas, with each thread bound to a specific arena, thereby avoiding lock contention on a single lock during concurrent multi-threaded allocation.
50%Unverifiedtcache maintains a free list of small objects within each thread, making the vast majority of allocation and deallocation operations completely lock-free, with cross-thread synchronization triggered only when the tcache is exhausted or memory needs to be returned to an arena.
50%Unverifiedjemalloc has a better reputation for memory fragmentation control and memory footprint stability after long periods of operation, making it particularly suitable for server-side scenarios requiring long-term stable operation, such as databases.
50%UnverifiedJemalloc released version 5.4.0.
50%