← All stories
● Covered by 1 source · 1 reportMedium impact1 neutral

Jemalloc 5.4.0 Released with Portability Improvements and Bug Fixes

🔄 Updated 5d ago
New to BrevFeed? We gather this story from every outlet covering it into one summary — ranked by real-world impact, not just the latest headline — so you never miss what matters. What is BrevFeed? →

Key points

  • Adds EXTENT_ALLOC_FLAG_PINNED for non-reclaimable memory.
  • Allows resuming per-CPU arena selection via thread.arena.
  • Replaces runtime experimental_infallible_new with compile-time option.
  • Adapts tcache fill/retention to demand, removing seven legacy controls.

Technical Debt and Portability Focus

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 Introduced

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.

Incompatible Changes to Tcache Management

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`.

Key Bug Fixes

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 →

The daily brief

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.

Today's brief

Spend a few minutes, get the whole day. Every topic's top stories in one hands-free rundown — listen, watch, or read the transcript.

~26 min · 21 stories · Sep 23

▶ Play today's brief Listen on Spotify

New every morning, and the back catalogue is archived by date.

Reporting from

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.