RC RANDOM CHAOS

Jemalloc 5.4.0 lands with 160+ commits: pinned-memory tracking, tcache cleanup, deadlock fixes

· via Hacker News

Original source

Jemalloc 5.4.0

Hacker News →

Jemalloc, the widely deployed general-purpose memory allocator, shipped version 5.4.0 on September 17, 2024, folding in more than 160 commits. The release leans heavily toward maintenance rather than headline features: a large refactoring pass that modularized the allocator’s front end, untangled tcache and arena ownership, added an OS abstraction layer, and removed the PAI vtable dispatch to simplify page-allocation boundaries. Alongside the internal cleanup, it retires several long-standing tuning options.

The notable functional additions are targeted at systems and performance work. A new EXTENT_ALLOC_FLAG_PINNED marks non-reclaimable mappings such as HugeTLB pages so they get preferential reuse, backed by new mallctl interfaces that report pinned-memory usage. Per-CPU arena selection can now be resumed through thread.arena, human-readable and JSON stats output were brought into closer alignment, and C++ infallible-new moved from a runtime setting to a compile-time —enable-cxx-infallible-new flag. Operators should note an incompatible change: seven legacy tcache controls (including lg_tcache_nslots_mul and the flush-div knobs) are gone and now silently ignored, so any configs relying on them will quietly lose effect.

The bug fixes matter most for correctness-sensitive deployments. This release preserves errno across free() and purging, fixes numeric overflow in size-class checks, corrects NULL handling in free_sized() and free_aligned_sized() for C23 compliance, resolves thread-teardown and TSD lifecycle edge cases, and closes a potential deadlock during arena_reset plus a prof-sampling/guard-page interaction bug. For the many databases, runtimes, and language toolchains that link jemalloc, the deadlock and errno fixes alone are reason to track this version.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.