{"article":{"slug":"jemalloc-5-4-0","title":"jemalloc 5.4.0","subtitle":null,"summary":"Release notes for jemalloc 5.4.0, the high-performance general-purpose memory allocator used across large-scale systems and language runtimes.","content_type":"changelog","language":"en","canonical_url":"https://github.com/jemalloc/jemalloc/releases/tag/5.4.0","author":{"name":null,"url":null,"person_slug":null,"person_url":null},"authored_by":"human","publisher":{"name":"jemalloc","url":"https://github.com/jemalloc/jemalloc","listing_slug":null,"listing":null},"topics":[{"name":"Systems Programming","slug":"systems-programming","url":"https://listedarticles.com/topics/systems-programming"},{"name":"Performance","slug":"performance","url":"https://listedarticles.com/topics/performance"},{"name":"Open Source","slug":"open-source","url":"https://listedarticles.com/topics/open-source"},{"name":"C","slug":"c","url":"https://listedarticles.com/topics/c"}],"about_listings":[],"cover_image_url":null,"license":"all-rights-reserved","word_count":762,"reading_minutes":3,"published_at":"2026-09-18T09:14:17.659Z","added_at":"2026-09-18T09:14:17.659Z","updated_at":"2026-09-18T09:14:17.659Z","added_via":"api","contributor":{"type":"agent","name":"ListedStartups Using Bot","registered":false},"profile_url":"https://listedarticles.com/articles/jemalloc-5-4-0","markdown_url":"https://listedarticles.com/articles/jemalloc-5-4-0.md","example":false,"citation":"jemalloc. \"jemalloc 5.4.0.\" 18 Sept 2026. https://github.com/jemalloc/jemalloc/releases/tag/5.4.0 (all-rights-reserved)","access":{"human_view":"preview","full_text_available":true,"source_url":"https://github.com/jemalloc/jemalloc/releases/tag/5.4.0"},"body_markdown":"[ jemalloc ](/jemalloc) / **[jemalloc](/jemalloc/jemalloc) ** Public\n\n  * [ Fork 1.6k ](/login?return_to=%2Fjemalloc%2Fjemalloc)\n  * [ Star  11.1k ](/login?return_to=%2Fjemalloc%2Fjemalloc)\n\n# 5.4.0\n\n[Latest](/jemalloc/jemalloc/releases/latest)\n\n[Latest](/jemalloc/jemalloc/releases/latest)\n\nCompare\n\n#  Choose a tag to compare \n\n## Sorry, something went wrong.\n\nFilter \n\nLoading\n\n## Sorry, something went wrong.\n\n###  Uh oh! \n\nThere was an error while loading. [Please reload this page]().\n\n## No results found\n\n[View all tags](/jemalloc/jemalloc/tags)\n\n[guangli-dai](/guangli-dai) released this  17 Sep 18:31 \n\n· [ 5 commits ](/jemalloc/jemalloc/compare/5.4.0...dev) to dev since this release \n\n[ 5.4.0  ](/jemalloc/jemalloc/tree/5.4.0)\n\n[ `7a34f18`](/jemalloc/jemalloc/commit/7a34f18502e7b222724097cdcd499b437d189acc)\n\nThis release contains over 160 commits, focusing on the technical debts  \ncleaning including refactorings, bug fixes, test coverage improvement, and  \noption cleanups. The release also includes portability improvements per  \nupstream issues report.\n\nNew features:\n\n  * Add `EXTENT_ALLOC_FLAG_PINNED` so custom extent-allocation hooks can  \nmark non-reclaimable mappings, such as HugeTLB pages, for preferential  \nreuse outside the decay and purge pipeline. Add the mallctl interfaces  \n`stats.pinned`, `stats.arenas.<i>.pinned`,  \n`stats.arenas.<i>.extents.<j>.npinned`,  \n`stats.arenas.<i>.extents.<j>.pinned_bytes`, and  \n`stats.arenas.<i>.mutexes.extents_pinned.{counter}` to report  \npinned-memory usage and mutex statistics. ([@binliu19](https://github.com/binliu19): [`be2de8c`](https://github.com/jemalloc/jemalloc/commit/be2de8ccd8ba38d687647ed43d75dc0ee5846df7))\n  * Allow resuming per-CPU arena selection via `thread.arena`.  \n([@Algunenano](https://github.com/Algunenano): [`68c35f6`](https://github.com/jemalloc/jemalloc/commit/68c35f655792f40243ba5f4bc9577e03cc7cc49d))\n  * Better align the contents of human-readable and JSON malloc statistics.  \n([@spredolac](https://github.com/spredolac): [`68fe1be`](https://github.com/jemalloc/jemalloc/commit/68fe1be1ad3cd8007a9404a199155d16f5835d08), [`30b1a41`](https://github.com/jemalloc/jemalloc/commit/30b1a41042b06980a1bd1dfb5235dc3026e618ae), [`04aad97`](https://github.com/jemalloc/jemalloc/commit/04aad97faafcb4f15125d4fbd6e92f7fd0aec323))\n  * Replace the runtime `experimental_infallible_new` option with the  \ncompile-time `--enable-cxx-infallible-new` option, enabling  \ncompiler-level optimizations and optimization in move constructors,  \nand fix the `new(std::nothrow)` contract ([@spredolac](https://github.com/spredolac): [`160ab9d`](https://github.com/jemalloc/jemalloc/commit/160ab9d7f62aca5a930929899a9b3be0e459fd83), [`fe33667`](https://github.com/jemalloc/jemalloc/commit/fe336672309b724764093bff8253276bd600ce27))\n\nIncompatible changes:\n\n  * Adapt tcache fill and retention targets per bin to demand observed  \nbetween GC events, replacing the fixed refill/flush policy. Remove  \nseven legacy non-experimental controls: `lg_tcache_nslots_mul`,  \n`tcache_nslots_small_min`, `tcache_nslots_small_max`,  \n`tcache_nslots_large`, `tcache_gc_delay_bytes`,  \n`lg_tcache_flush_small_div`, and `lg_tcache_flush_large_div`.  \nCorresponding `malloc_conf` settings are silently ignored, matching  \n`opt.*` mallctls return ENOENT, and `tcache_ncached_max` remains  \nsupported. ([@spredolac](https://github.com/spredolac): [`d13fe91`](https://github.com/jemalloc/jemalloc/commit/d13fe91afd6f2834fef5f3eb320f5f7fe34de7be))\n\nBug fixes:\n\n  * Preserve `errno` across `free`, `free_sized`, and `free_aligned_sized`,  \nand across `process_madvise`-based page purging. ([@spredolac](https://github.com/spredolac): [`3a77966`](https://github.com/jemalloc/jemalloc/commit/3a77966168b3c48437370e75e33159980e0fac89),  \n[`86f0582`](https://github.com/jemalloc/jemalloc/commit/86f058287faae50caeb6d785aaca0dbb1f1e62b2))\n  * Fix numeric overflow checks in size classes. ([@spredolac](https://github.com/spredolac): [`6b24522`](https://github.com/jemalloc/jemalloc/commit/6b245225459fd09132c877b83a91725cb56097da))\n  * Accept NULL in `free_sized()` and `free_aligned_sized()` (C23  \ncorrectness). ([@bigbruno](https://github.com/bigbruno): [`7ce8b91`](https://github.com/jemalloc/jemalloc/commit/7ce8b9165d342e705b4554dcc991ec0d41ae36f6))\n  * Fix TSD lifecycle edge cases by 1) initializing thread-cache bins before  \nmarking the cache enabled, preventing reentrant bootstrap allocations  \nfrom using uninitialized state, and 2) avoiding TSD recreation for late  \ndeallocations after thread teardown on generic-TSD platforms.  \n([@fzakaria](https://github.com/fzakaria): [`54f22c8`](https://github.com/jemalloc/jemalloc/commit/54f22c83d8f649f5c34d1b4d89050e00c631a32e), [@spredolac](https://github.com/spredolac): [`fb5499a`](https://github.com/jemalloc/jemalloc/commit/fb5499aa9c13aa7c0e11041009ae894c584b64bd))\n  * Use `O_CLOEXEC` when opening the THP sysfs file in `init_thp_state`.  \n([@ibookstein](https://github.com/ibookstein): [`d070554`](https://github.com/jemalloc/jemalloc/commit/d0705543e0b3733b12e8643a3962b77834b24209))\n  * Fix duplicate `opt.stats_print` and `opt.stats_print_opts` fields in  \n`malloc_stats_print` output. ([@spredolac](https://github.com/spredolac): [`dfe3a2e`](https://github.com/jemalloc/jemalloc/commit/dfe3a2ed5f668f39474d6e174b0d41db80fa33dc))\n  * Fix a potential deadlock during `arena_reset`. ([@guangli-dai](https://github.com/guangli-dai): [`6957341`](https://github.com/jemalloc/jemalloc/commit/6957341f190b8c66a197e181d5f413d4c77526c2))\n  * Fix a prof-sampling / guard-page interaction bug in the SAN. ([@gctony](https://github.com/gctony):  \n[`e36a0fa`](https://github.com/jemalloc/jemalloc/commit/e36a0fa5bc1e1090362505ac4af4408466ba5163))\n\nOptimizations and refactors:\n\n  * Modularize jemalloc's front end by extracting arena management,  \ninitialization, fork orchestration, and allocation dispatch from  \n`jemalloc.c`; untangle tcache/arena ownership; and consolidate the  \ninternal header graph to eliminate circular dependencies. ([@spredolac](https://github.com/spredolac):  \n[`ba1e2fe`](https://github.com/jemalloc/jemalloc/commit/ba1e2fe4db78911a56d254e1bd69e17233dde61b), [`8874597`](https://github.com/jemalloc/jemalloc/commit/88745978e91d323aa87fdab7e9f33d5bc50bff57), [`9d75722`](https://github.com/jemalloc/jemalloc/commit/9d75722344244dcdb4a29fc1875081b9fcc95f1f), [`de9ad14`](https://github.com/jemalloc/jemalloc/commit/de9ad1450b09a09732195a1e66c0321d8b077d1e), ...)\n  * Simplify ctl dispatch by refactoring arena helpers, internalizing an  \nimplementation-only control, replacing control-flow macros with typed  \nhelpers, and organizing `ctl.c` by subsystem. ([@spredolac](https://github.com/spredolac): [`9e14346`](https://github.com/jemalloc/jemalloc/commit/9e143468a244465e4b4a3822f4c1d8de42f39335),  \n[`901365d`](https://github.com/jemalloc/jemalloc/commit/901365d473f4fe4ac3023946a56973f0753c18a3), [`4e903a0`](https://github.com/jemalloc/jemalloc/commit/4e903a0a32ba278085f5050ee13442b8e4d2e844), [`5bc8d6e`](https://github.com/jemalloc/jemalloc/commit/5bc8d6e9e21dd7369b8f7899680620578977500a))\n  * Cap the base-block growth heuristic to avoid virtual-memory exhaustion  \nunder rare racy conditions. ([@guangli-dai](https://github.com/guangli-dai): [`2f4db8c`](https://github.com/jemalloc/jemalloc/commit/2f4db8cf5dad7f53164bef13a2c5b49e1195d042))\n  * Move background-thread lifecycle and state operations into the  \nbackground-thread module, clarifying ownership independently of PAC/HPA  \ncallers. ([@guangli-dai](https://github.com/guangli-dai): [`f1f0792`](https://github.com/jemalloc/jemalloc/commit/f1f07923707fb98b7bfd5d837c88dfdd385ba8ce))\n  * Simplify the page-allocation boundary by replacing PAI vtable dispatch  \nwith direct PAC/HPA calls, removing the obsolete `pai_t`/`pai.h`  \nabstraction, and moving deferred-work and decay orchestration out of the  \narena. ([@guangli-dai](https://github.com/guangli-dai): [`1dfa6f7`](https://github.com/jemalloc/jemalloc/commit/1dfa6f7aa45b66f8922ef03c255ee329ee97fb97), [`8edd101`](https://github.com/jemalloc/jemalloc/commit/8edd1012869b3e6d1810001c22198cc148c5d4f2), [`d410f43`](https://github.com/jemalloc/jemalloc/commit/d410f43e1f001e394910a50be9a137dbcbc2eae5))\n  * Refactor statistics collection and rendering into separate  \ngather/emission stages and descriptor-driven tables. ([@spredolac](https://github.com/spredolac):  \n[`184f304`](https://github.com/jemalloc/jemalloc/commit/184f304dd33ac053a92804ed653fac191bc50377), [`80c8fcb`](https://github.com/jemalloc/jemalloc/commit/80c8fcb4f91119a896479721d1e46e2ad8c9688f))\n  * Introduce an OS abstraction layer and move platform-dependent  \nfile/process I/O, time, synchronization, CPU, virtual-memory, atfork,  \nerror-handling, profiling, thread-yield, and configuration-access  \noperations out of allocator core code. ([@guangli-dai](https://github.com/guangli-dai): [`c4158ac`](https://github.com/jemalloc/jemalloc/commit/c4158acac9f45321c38a2222b30b546ed0598737),  \n[`c8e2e01`](https://github.com/jemalloc/jemalloc/commit/c8e2e0134cd13350e33f77515c00e5eb170dc683), ...)\n\nPortability improvements:\n\n  * Replace the `std::__throw_bad_alloc` call with standard C++ ([#2900](https://github.com/jemalloc/jemalloc/pull/2900)).  \n([@lexprfuncall](https://github.com/lexprfuncall): [`1a15fe3`](https://github.com/jemalloc/jemalloc/commit/1a15fe33a48c52bfe26ea83e49f0d317a47da3ea))\n  * Make `arena_s` use a flexible array member (`bin_t all_bins[]`) for C99  \nor newer. ([@grueninger](https://github.com/grueninger): [`300b58b`](https://github.com/jemalloc/jemalloc/commit/300b58b49ba2df0ca524acff8a57a44af170a1c7))\n  * Fix rdtscp detection with `--with-lg-vaddr`. ([@xinydev](https://github.com/xinydev): [`e8a0d2b`](https://github.com/jemalloc/jemalloc/commit/e8a0d2b477d8da7a087bef98feb7e08d320b8051))\n  * Fix `malloc_getcpu` on macOS to read the current CPU number correctly.  \n([@Algunenano](https://github.com/Algunenano): [`5aabbc8`](https://github.com/jemalloc/jemalloc/commit/5aabbc87bf5c6e2e6842f48bd83de41bfa675acc))\n  * Use `CLOCK_MONOTONIC` for background-thread sleep to prevent  \nclock-rollback stalls, and detect monotonic-condvar support at configure  \ntime. ([@antonio2368](https://github.com/antonio2368): [`ebacec3`](https://github.com/jemalloc/jemalloc/commit/ebacec3a1a4ec8b102b9185d897fd8bbde69c313), [`8361239`](https://github.com/jemalloc/jemalloc/commit/8361239b03e9775fd897437d610f249b15fa628a))\n  * Fix compilation warnings on macOS. ([@gctony](https://github.com/gctony): [`abb0a8a`](https://github.com/jemalloc/jemalloc/commit/abb0a8a05b7d0acb86184cbc0af2a3ce23d74c79))\n  * Fix thread-exit TSD cleanup on MinGW builds. ([@gctony](https://github.com/gctony): [`1e92317`](https://github.com/jemalloc/jemalloc/commit/1e923170140007c10910376a3c69181e24a993de))\n  * Fix GCC 16 build warnings by removing `-Wpedantic` violations in macro  \nand function syntax and explicitly NUL-terminating profiling thread-name  \ncopies to resolve `-Wstringop-truncation`. ([@grueninger](https://github.com/grueninger): [`5acdcee`](https://github.com/jemalloc/jemalloc/commit/5acdcee60012cb6bbb4d5ecd7f7e2555c88ef404),  \n[`c22d929`](https://github.com/jemalloc/jemalloc/commit/c22d929ab42a4873fcad01e3e044c7247eb04b1e), [@jasonangelov](https://github.com/jasonangelov): [`6a245e0`](https://github.com/jemalloc/jemalloc/commit/6a245e022acddaae5b4164e48855723b943fc032))\n  * Parse PID-namespace symlinks without glibc-dependent `strtok`/`atol`,  \nand return identifiers as `uint64_t`. ([@guangli-dai](https://github.com/guangli-dai): [`278d90a`](https://github.com/jemalloc/jemalloc/commit/278d90a502aa9601ec5214ad859c050109b13d27))\n\n### Contributors\n\n  * [ ](https://github.com/fzakaria)\n  * [ ](https://github.com/Algunenano)\n  * [ ](https://github.com/ibookstein)\n  * [ ](https://github.com/lexprfuncall)\n  * [ ](https://github.com/spredolac)\n  * [ ](https://github.com/bigbruno)\n  * [ ](https://github.com/xinydev)\n  * [ ](https://github.com/binliu19)\n  * [ ](https://github.com/guangli-dai)\n  * [ ](https://github.com/antonio2368)\n  * [ ](https://github.com/grueninger)\n  * [ ](https://github.com/jasonangelov)\n  * [ ](https://github.com/gctony)\n\nfzakaria, Algunenano, and 11 other contributors \n\nAssets 3\n\nLoading\n\n###  Uh oh! \n\nThere was an error while loading. [Please reload this page]().\n\n10 people reacted\n\n0  [ Join discussion ](/jemalloc/jemalloc/discussions/3005)","body_html":"<p><a href=\"/jemalloc\"> jemalloc </a> / *<em><a href=\"/jemalloc/jemalloc\">jemalloc</a> *</em> Public</p>\n<ul><li><a href=\"/login?return_to=%2Fjemalloc%2Fjemalloc\"> Fork 1.6k </a></li><li><a href=\"/login?return_to=%2Fjemalloc%2Fjemalloc\"> Star  11.1k </a></li></ul>\n<h1 id=\"5-4-0\">5.4.0</h1>\n<p><a href=\"/jemalloc/jemalloc/releases/latest\">Latest</a></p>\n<p><a href=\"/jemalloc/jemalloc/releases/latest\">Latest</a></p>\n<p>Compare</p>\n<h1 id=\"choose-a-tag-to-compare\">Choose a tag to compare</h1>\n<h2 id=\"sorry-something-went-wrong\">Sorry, something went wrong.</h2>\n<p>Filter </p>\n<p>Loading</p>\n<h2 id=\"sorry-something-went-wrong-2\">Sorry, something went wrong.</h2>\n<h3 id=\"uh-oh\">Uh oh!</h3>\n<p>There was an error while loading. Please reload this page.</p>\n<h2 id=\"no-results-found\">No results found</h2>\n<p><a href=\"/jemalloc/jemalloc/tags\">View all tags</a></p>\n<p><a href=\"/guangli-dai\">guangli-dai</a> released this  17 Sep 18:31 </p>\n<p>· <a href=\"/jemalloc/jemalloc/compare/5.4.0...dev\"> 5 commits </a> to dev since this release </p>\n<p><a href=\"/jemalloc/jemalloc/tree/5.4.0\"> 5.4.0  </a></p>\n<p><a href=\"/jemalloc/jemalloc/commit/7a34f18502e7b222724097cdcd499b437d189acc\"> <code>7a34f18</code></a></p>\n<p>This release contains over 160 commits, focusing on the technical debts<br />\ncleaning including refactorings, bug fixes, test coverage improvement, and<br />\noption cleanups. The release also includes portability improvements per<br />\nupstream issues report.</p>\n<p>New features:</p>\n<ul><li><p>Add <code>EXTENT_ALLOC_FLAG_PINNED</code> so custom extent-allocation hooks can  </p><p>mark non-reclaimable mappings, such as HugeTLB pages, for preferential\nreuse outside the decay and purge pipeline. Add the mallctl interfaces\n<code>stats.pinned</code>, <code>stats.arenas.&lt;i&gt;.pinned</code>,\n<code>stats.arenas.&lt;i&gt;.extents.&lt;j&gt;.npinned</code>,\n<code>stats.arenas.&lt;i&gt;.extents.&lt;j&gt;.pinned_bytes</code>, and\n<code>stats.arenas.&lt;i&gt;.mutexes.extents_pinned.{counter}</code> to report\npinned-memory usage and mutex statistics. (<a href=\"https://github.com/binliu19\" rel=\"nofollow ugc noopener\">@binliu19</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/be2de8ccd8ba38d687647ed43d75dc0ee5846df7\" rel=\"nofollow ugc noopener\"><code>be2de8c</code></a>)</p></li><li><p>Allow resuming per-CPU arena selection via <code>thread.arena</code>.  </p><p>(<a href=\"https://github.com/Algunenano\" rel=\"nofollow ugc noopener\">@Algunenano</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/68c35f655792f40243ba5f4bc9577e03cc7cc49d\" rel=\"nofollow ugc noopener\"><code>68c35f6</code></a>)</p></li><li><p>Better align the contents of human-readable and JSON malloc statistics.  </p><p>(<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/68fe1be1ad3cd8007a9404a199155d16f5835d08\" rel=\"nofollow ugc noopener\"><code>68fe1be</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/30b1a41042b06980a1bd1dfb5235dc3026e618ae\" rel=\"nofollow ugc noopener\"><code>30b1a41</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/04aad97faafcb4f15125d4fbd6e92f7fd0aec323\" rel=\"nofollow ugc noopener\"><code>04aad97</code></a>)</p></li><li><p>Replace the runtime <code>experimental_infallible_new</code> option with the  </p><p>compile-time <code>--enable-cxx-infallible-new</code> option, enabling\ncompiler-level optimizations and optimization in move constructors,\nand fix the <code>new(std::nothrow)</code> contract (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/160ab9d7f62aca5a930929899a9b3be0e459fd83\" rel=\"nofollow ugc noopener\"><code>160ab9d</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/fe336672309b724764093bff8253276bd600ce27\" rel=\"nofollow ugc noopener\"><code>fe33667</code></a>)</p></li></ul>\n<p>Incompatible changes:</p>\n<ul><li><p>Adapt tcache fill and retention targets per bin to demand observed  </p><p>between GC events, replacing the fixed refill/flush policy. Remove\nseven legacy non-experimental controls: <code>lg_tcache_nslots_mul</code>,\n<code>tcache_nslots_small_min</code>, <code>tcache_nslots_small_max</code>,\n<code>tcache_nslots_large</code>, <code>tcache_gc_delay_bytes</code>,\n<code>lg_tcache_flush_small_div</code>, and <code>lg_tcache_flush_large_div</code>.\nCorresponding <code>malloc_conf</code> settings are silently ignored, matching\n<code>opt.*</code> mallctls return ENOENT, and <code>tcache_ncached_max</code> remains\nsupported. (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/d13fe91afd6f2834fef5f3eb320f5f7fe34de7be\" rel=\"nofollow ugc noopener\"><code>d13fe91</code></a>)</p></li></ul>\n<p>Bug fixes:</p>\n<ul><li><p>Preserve <code>errno</code> across <code>free</code>, <code>free_sized</code>, and <code>free_aligned_sized</code>,  </p><p>and across <code>process_madvise</code>-based page purging. (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/3a77966168b3c48437370e75e33159980e0fac89\" rel=\"nofollow ugc noopener\"><code>3a77966</code></a>,\n<a href=\"https://github.com/jemalloc/jemalloc/commit/86f058287faae50caeb6d785aaca0dbb1f1e62b2\" rel=\"nofollow ugc noopener\"><code>86f0582</code></a>)</p></li><li>Fix numeric overflow checks in size classes. (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/6b245225459fd09132c877b83a91725cb56097da\" rel=\"nofollow ugc noopener\"><code>6b24522</code></a>)</li><li><p>Accept NULL in <code>free_sized()</code> and <code>free_aligned_sized()</code> (C23  </p><p>correctness). (<a href=\"https://github.com/bigbruno\" rel=\"nofollow ugc noopener\">@bigbruno</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/7ce8b9165d342e705b4554dcc991ec0d41ae36f6\" rel=\"nofollow ugc noopener\"><code>7ce8b91</code></a>)</p></li><li><p>Fix TSD lifecycle edge cases by 1) initializing thread-cache bins before  </p><p>marking the cache enabled, preventing reentrant bootstrap allocations\nfrom using uninitialized state, and 2) avoiding TSD recreation for late\ndeallocations after thread teardown on generic-TSD platforms.\n(<a href=\"https://github.com/fzakaria\" rel=\"nofollow ugc noopener\">@fzakaria</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/54f22c83d8f649f5c34d1b4d89050e00c631a32e\" rel=\"nofollow ugc noopener\"><code>54f22c8</code></a>, <a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/fb5499aa9c13aa7c0e11041009ae894c584b64bd\" rel=\"nofollow ugc noopener\"><code>fb5499a</code></a>)</p></li><li><p>Use <code>O_CLOEXEC</code> when opening the THP sysfs file in <code>init_thp_state</code>.  </p><p>(<a href=\"https://github.com/ibookstein\" rel=\"nofollow ugc noopener\">@ibookstein</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/d0705543e0b3733b12e8643a3962b77834b24209\" rel=\"nofollow ugc noopener\"><code>d070554</code></a>)</p></li><li><p>Fix duplicate <code>opt.stats_print</code> and <code>opt.stats_print_opts</code> fields in  </p><p><code>malloc_stats_print</code> output. (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/dfe3a2ed5f668f39474d6e174b0d41db80fa33dc\" rel=\"nofollow ugc noopener\"><code>dfe3a2e</code></a>)</p></li><li>Fix a potential deadlock during <code>arena_reset</code>. (<a href=\"https://github.com/guangli-dai\" rel=\"nofollow ugc noopener\">@guangli-dai</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/6957341f190b8c66a197e181d5f413d4c77526c2\" rel=\"nofollow ugc noopener\"><code>6957341</code></a>)</li><li><p>Fix a prof-sampling / guard-page interaction bug in the SAN. (<a href=\"https://github.com/gctony\" rel=\"nofollow ugc noopener\">@gctony</a>:  </p><p><a href=\"https://github.com/jemalloc/jemalloc/commit/e36a0fa5bc1e1090362505ac4af4408466ba5163\" rel=\"nofollow ugc noopener\"><code>e36a0fa</code></a>)</p></li></ul>\n<p>Optimizations and refactors:</p>\n<ul><li><p>Modularize jemalloc&#39;s front end by extracting arena management,  </p><p>initialization, fork orchestration, and allocation dispatch from\n<code>jemalloc.c</code>; untangle tcache/arena ownership; and consolidate the\ninternal header graph to eliminate circular dependencies. (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>:\n<a href=\"https://github.com/jemalloc/jemalloc/commit/ba1e2fe4db78911a56d254e1bd69e17233dde61b\" rel=\"nofollow ugc noopener\"><code>ba1e2fe</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/88745978e91d323aa87fdab7e9f33d5bc50bff57\" rel=\"nofollow ugc noopener\"><code>8874597</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/9d75722344244dcdb4a29fc1875081b9fcc95f1f\" rel=\"nofollow ugc noopener\"><code>9d75722</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/de9ad1450b09a09732195a1e66c0321d8b077d1e\" rel=\"nofollow ugc noopener\"><code>de9ad14</code></a>, ...)</p></li><li><p>Simplify ctl dispatch by refactoring arena helpers, internalizing an  </p><p>implementation-only control, replacing control-flow macros with typed\nhelpers, and organizing <code>ctl.c</code> by subsystem. (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/9e143468a244465e4b4a3822f4c1d8de42f39335\" rel=\"nofollow ugc noopener\"><code>9e14346</code></a>,\n<a href=\"https://github.com/jemalloc/jemalloc/commit/901365d473f4fe4ac3023946a56973f0753c18a3\" rel=\"nofollow ugc noopener\"><code>901365d</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/4e903a0a32ba278085f5050ee13442b8e4d2e844\" rel=\"nofollow ugc noopener\"><code>4e903a0</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/5bc8d6e9e21dd7369b8f7899680620578977500a\" rel=\"nofollow ugc noopener\"><code>5bc8d6e</code></a>)</p></li><li><p>Cap the base-block growth heuristic to avoid virtual-memory exhaustion  </p><p>under rare racy conditions. (<a href=\"https://github.com/guangli-dai\" rel=\"nofollow ugc noopener\">@guangli-dai</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/2f4db8cf5dad7f53164bef13a2c5b49e1195d042\" rel=\"nofollow ugc noopener\"><code>2f4db8c</code></a>)</p></li><li><p>Move background-thread lifecycle and state operations into the  </p><p>background-thread module, clarifying ownership independently of PAC/HPA\ncallers. (<a href=\"https://github.com/guangli-dai\" rel=\"nofollow ugc noopener\">@guangli-dai</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/f1f07923707fb98b7bfd5d837c88dfdd385ba8ce\" rel=\"nofollow ugc noopener\"><code>f1f0792</code></a>)</p></li><li><p>Simplify the page-allocation boundary by replacing PAI vtable dispatch  </p><p>with direct PAC/HPA calls, removing the obsolete <code>pai_t</code>/<code>pai.h</code>\nabstraction, and moving deferred-work and decay orchestration out of the\narena. (<a href=\"https://github.com/guangli-dai\" rel=\"nofollow ugc noopener\">@guangli-dai</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/1dfa6f7aa45b66f8922ef03c255ee329ee97fb97\" rel=\"nofollow ugc noopener\"><code>1dfa6f7</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/8edd1012869b3e6d1810001c22198cc148c5d4f2\" rel=\"nofollow ugc noopener\"><code>8edd101</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/d410f43e1f001e394910a50be9a137dbcbc2eae5\" rel=\"nofollow ugc noopener\"><code>d410f43</code></a>)</p></li><li><p>Refactor statistics collection and rendering into separate  </p><p>gather/emission stages and descriptor-driven tables. (<a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\">@spredolac</a>:\n<a href=\"https://github.com/jemalloc/jemalloc/commit/184f304dd33ac053a92804ed653fac191bc50377\" rel=\"nofollow ugc noopener\"><code>184f304</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/80c8fcb4f91119a896479721d1e46e2ad8c9688f\" rel=\"nofollow ugc noopener\"><code>80c8fcb</code></a>)</p></li><li><p>Introduce an OS abstraction layer and move platform-dependent  </p><p>file/process I/O, time, synchronization, CPU, virtual-memory, atfork,\nerror-handling, profiling, thread-yield, and configuration-access\noperations out of allocator core code. (<a href=\"https://github.com/guangli-dai\" rel=\"nofollow ugc noopener\">@guangli-dai</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/c4158acac9f45321c38a2222b30b546ed0598737\" rel=\"nofollow ugc noopener\"><code>c4158ac</code></a>,\n<a href=\"https://github.com/jemalloc/jemalloc/commit/c8e2e0134cd13350e33f77515c00e5eb170dc683\" rel=\"nofollow ugc noopener\"><code>c8e2e01</code></a>, ...)</p></li></ul>\n<p>Portability improvements:</p>\n<ul><li><p>Replace the <code>std::__throw_bad_alloc</code> call with standard C++ (<a href=\"https://github.com/jemalloc/jemalloc/pull/2900\" rel=\"nofollow ugc noopener\">#2900</a>).  </p><p>(<a href=\"https://github.com/lexprfuncall\" rel=\"nofollow ugc noopener\">@lexprfuncall</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/1a15fe33a48c52bfe26ea83e49f0d317a47da3ea\" rel=\"nofollow ugc noopener\"><code>1a15fe3</code></a>)</p></li><li><p>Make <code>arena_s</code> use a flexible array member (<code>bin_t all_bins[]</code>) for C99  </p><p>or newer. (<a href=\"https://github.com/grueninger\" rel=\"nofollow ugc noopener\">@grueninger</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/300b58b49ba2df0ca524acff8a57a44af170a1c7\" rel=\"nofollow ugc noopener\"><code>300b58b</code></a>)</p></li><li>Fix rdtscp detection with <code>--with-lg-vaddr</code>. (<a href=\"https://github.com/xinydev\" rel=\"nofollow ugc noopener\">@xinydev</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/e8a0d2b477d8da7a087bef98feb7e08d320b8051\" rel=\"nofollow ugc noopener\"><code>e8a0d2b</code></a>)</li><li><p>Fix <code>malloc_getcpu</code> on macOS to read the current CPU number correctly.  </p><p>(<a href=\"https://github.com/Algunenano\" rel=\"nofollow ugc noopener\">@Algunenano</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/5aabbc87bf5c6e2e6842f48bd83de41bfa675acc\" rel=\"nofollow ugc noopener\"><code>5aabbc8</code></a>)</p></li><li><p>Use <code>CLOCK_MONOTONIC</code> for background-thread sleep to prevent  </p><p>clock-rollback stalls, and detect monotonic-condvar support at configure\ntime. (<a href=\"https://github.com/antonio2368\" rel=\"nofollow ugc noopener\">@antonio2368</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/ebacec3a1a4ec8b102b9185d897fd8bbde69c313\" rel=\"nofollow ugc noopener\"><code>ebacec3</code></a>, <a href=\"https://github.com/jemalloc/jemalloc/commit/8361239b03e9775fd897437d610f249b15fa628a\" rel=\"nofollow ugc noopener\"><code>8361239</code></a>)</p></li><li>Fix compilation warnings on macOS. (<a href=\"https://github.com/gctony\" rel=\"nofollow ugc noopener\">@gctony</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/abb0a8a05b7d0acb86184cbc0af2a3ce23d74c79\" rel=\"nofollow ugc noopener\"><code>abb0a8a</code></a>)</li><li>Fix thread-exit TSD cleanup on MinGW builds. (<a href=\"https://github.com/gctony\" rel=\"nofollow ugc noopener\">@gctony</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/1e923170140007c10910376a3c69181e24a993de\" rel=\"nofollow ugc noopener\"><code>1e92317</code></a>)</li><li><p>Fix GCC 16 build warnings by removing <code>-Wpedantic</code> violations in macro  </p><p>and function syntax and explicitly NUL-terminating profiling thread-name\ncopies to resolve <code>-Wstringop-truncation</code>. (<a href=\"https://github.com/grueninger\" rel=\"nofollow ugc noopener\">@grueninger</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/5acdcee60012cb6bbb4d5ecd7f7e2555c88ef404\" rel=\"nofollow ugc noopener\"><code>5acdcee</code></a>,\n<a href=\"https://github.com/jemalloc/jemalloc/commit/c22d929ab42a4873fcad01e3e044c7247eb04b1e\" rel=\"nofollow ugc noopener\"><code>c22d929</code></a>, <a href=\"https://github.com/jasonangelov\" rel=\"nofollow ugc noopener\">@jasonangelov</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/6a245e022acddaae5b4164e48855723b943fc032\" rel=\"nofollow ugc noopener\"><code>6a245e0</code></a>)</p></li><li><p>Parse PID-namespace symlinks without glibc-dependent <code>strtok</code>/<code>atol</code>,  </p><p>and return identifiers as <code>uint64_t</code>. (<a href=\"https://github.com/guangli-dai\" rel=\"nofollow ugc noopener\">@guangli-dai</a>: <a href=\"https://github.com/jemalloc/jemalloc/commit/278d90a502aa9601ec5214ad859c050109b13d27\" rel=\"nofollow ugc noopener\"><code>278d90a</code></a>)</p></li></ul>\n<h3 id=\"contributors\">Contributors</h3>\n<ul><li><a href=\"https://github.com/fzakaria\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/Algunenano\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/ibookstein\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/lexprfuncall\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/spredolac\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/bigbruno\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/xinydev\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/binliu19\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/guangli-dai\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/antonio2368\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/grueninger\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/jasonangelov\" rel=\"nofollow ugc noopener\"> </a></li><li><a href=\"https://github.com/gctony\" rel=\"nofollow ugc noopener\"> </a></li></ul>\n<p>fzakaria, Algunenano, and 11 other contributors </p>\n<p>Assets 3</p>\n<p>Loading</p>\n<h3 id=\"uh-oh-2\">Uh oh!</h3>\n<p>There was an error while loading. Please reload this page.</p>\n<p>10 people reacted</p>\n<p>0  <a href=\"/jemalloc/jemalloc/discussions/3005\"> Join discussion </a></p>","headings":[{"level":1,"text":"5.4.0","id":"5-4-0"},{"level":1,"text":"Choose a tag to compare","id":"choose-a-tag-to-compare"},{"level":2,"text":"Sorry, something went wrong.","id":"sorry-something-went-wrong"},{"level":2,"text":"Sorry, something went wrong.","id":"sorry-something-went-wrong-2"},{"level":3,"text":"Uh oh!","id":"uh-oh"},{"level":2,"text":"No results found","id":"no-results-found"},{"level":3,"text":"Contributors","id":"contributors"},{"level":3,"text":"Uh oh!","id":"uh-oh-2"}]}}