Jemalloc 5.4.0 includes over 160 commits, primarily addressing technical debt through refactorings, bug fixes, and improved test coverage. The release also enhances portability, resolving issues reported upstream.
New features include EXTENT_ALLOC_FLAG_PINNED, allowing custom extent-allocation hooks to mark non-reclaimable mappings like HugeTLB pages for preferential reuse outside the decay and purge pipeline. Corresponding mallctl interfaces have been added to report pinned-memory usage and mutex statistics. The update also enables resuming per-CPU arena selection via `thread.arena` and improves alignment for human-readable and JSON malloc statistics. The `experimental_infallible_new` option has been replaced with a compile-time equivalent, `--enable-cxx-infallible-new`, which enables compiler-level optimizations and fixes the `new(std::nothrow)` contract.
The release introduces incompatible changes by adapting tcache fill and retention targets based on observed demand between GC events, replacing the previous fixed refill/flush policy. This change removes seven legacy non-experimental controls: `lg_tcache_nslots_mul`, `tcache_nslots_small_min`, `tcache_nslots_small_max`, `tcache_nslots_large`, `tcache_gc_delay_bytes`, `lg_tcache_flush_small_div`, and `lg_tcache_flush_large_div`. Corresponding `malloc_conf` settings are now silently ignored, and `opt.*` mallctls return `ENOENT`.
Several bugs have been resolved, including preserving `errno` across `free`, `free_sized`, `free_aligned_sized`, and `process_madvise`-based page purging. Numeric overflow checks in size classes have been fixed, and `NULL` is now accepted in `free_sized()` and `free_aligned_sized()` for C23 correctness. TSD lifecycle edge cases were addressed by initializing thread-cache bins before enabling the cache and avoiding TSD recreation for late deallocations. The release also fixes the use of `O_CLOEXEC` when opening the THP sysfs file and resolves duplicate `opt.stats_print` and `opt.stats_print_opts` fields.
✨ This summary was generated by AI from the outlets' reporting listed below. It is not independently verified and may contain errors — check the original sources. How BrevFeed works →
One email each morning: the day's tech stories, clustered across outlets and summarized. No account needed.
One email a day. Unsubscribe in one click, any time.
Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.
▶ Play today's briefNew every morning, and the back catalogue is archived by date.
Jemalloc 5.4.0 has been released, incorporating over 160 commits focused on technical debt cleanup, bug fixes, and portability improvements. This update introduces new features like pinned memory tracking and refines tcache management, while also making some incompatible changes to tcache fill and retention targets.