jemalloc 5.4.0 released with 160+ commits

Original: Jemalloc 5.4.0

Why This Matters

jemalloc underpins Redis, Meta's infrastructure, and many high-throughput systems; HugeTLB pinning support directly benefits large-memory workloads.

The jemalloc memory allocator released version 5.4.0 on September 17, 2025, incorporating over 160 commits. Key additions include EXTENT_ALLOC_FLAG_PINNED for HugeTLB page support, new mallctl stats interfaces, per-CPU arena resumption, and a compile-time C++ infallible-new option.

jemalloc 5.4.0 ships with over 160 commits, primarily targeting technical debt: refactoring, bug fixes, expanded test coverage, and option cleanups. Portability improvements were also driven by upstream issue reports.

The headline new feature is EXTENT_ALLOC_FLAG_PINNED, which lets custom extent-allocation hooks mark non-reclaimable mappings—such as HugeTLB pages—for preferential reuse outside the normal decay and purge pipeline. Accompanying mallctl interfaces expose pinned-memory usage and mutex statistics across arenas and extents.

Per-CPU arena selection can now be resumed via thread.arena, contributed by @Algunenano. Human-readable and JSON malloc statistics outputs were better aligned by @spredolac. On the C++ side, the runtime experimental_infallible_new option is replaced by the compile-time --enable-cxx-infallible-new flag, enabling compiler-level optimizations including move-constructor improvements and fixing the new(std::nothrow) contract.

One notable incompatible change: tcache fill and retention targets per bin now adapt dynamically to demand observed between GC events, replacing the previous fixed refill behavior.

Source

github.com — Read original →