hn.today

Jemalloc 5.4.0

github.com167 points47 comments
Screenshot of Jemalloc 5.4.0

jemalloc 5.4.0 is a major maintenance-and-refactor release comprising over 160 commits that clean up technical debt, improve portability, beef up tests, and add a few targeted features. Notable additions include EXTENT_ALLOC_FLAG_PINNED and corresponding mallctl stats (stats.pinned, stats.arenas..pinned, stats.arenas..extents..npinned, stats.arenas..extents..pinned_bytes, and stats.arenas..mutexes.extents_pinned.{counter}) to support non-reclaimable mappings like HugeTLB pages; the ability to resume per-CPU arena selection via thread.arena; tighter alignment between human-readable and JSON malloc stats; and replacing the runtime experimental_infallible_new option with a compile-time enable-cxx-infallible-new to enable compiler optimizations and fix new(std::nothrow). An incompatible behavioral change adapts tcache fill/retention per bin based on demand, removing seven legacy controls (their malloc_conf settings are silently ignored and corresponding mallctls return ENOENT).

The release fixes a range of bugs (preserving errno across frees and purges, numeric overflow checks in size classes, accepting NULL in free_sized/free_aligned_sized, TSD lifecycle edge cases, THP sysfs O_CLOEXEC, duplicate stats_print fields, arena_reset deadlock, and a prof-sampling/guard-page SAN bug). Internals were refactored: modularized front end, simplified ctl dispatch, capped base-block growth heuristic, moved background-thread and page-allocation responsibilities into clearer modules, refactored stats collection, and added an OS abstraction layer. Portability and build fixes target macOS, MinGW, GCC 16, rdtscp detection, CLOCK_MONOTONIC for background sleeps, and PID-namespace parsing. Multiple contributors implemented these changes.

Read on github.com47 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.