1 Following are change highlights associated with official releases. Important 2 bug fixes are all mentioned, but some internal enhancements are omitted here for 3 brevity. Much more detail can be found in the git revision history: 4 5 https://github.com/jemalloc/jemalloc 6 7 * 5.3.1 (Apr 13, 2026) 8 9 This release includes over 390 commits spanning bug fixes, new features, 10 performance optimizations, and portability improvements. Multiple percent 11 of system-level metric improvements were measured in tested production 12 workloads. The release has gone through large-scale production testing 13 at Meta. 14 15 New features: 16 - Support pvalloc. (@Lapenkov: 5b1f2cc5) 17 - Add double free detection for the debug build. (@izaitsevfb: 18 36366f3c, @guangli-dai: 42daa1ac, @divanorama: 1897f185) 19 - Add compile-time option `--enable-pageid` to enable memory mapping 20 annotation. (@devnexen: 4fc5c4fb) 21 - Add runtime option `prof_bt_max` to control the max stack depth for 22 profiling. (@guangli-dai: a0734fd6) 23 - Add compile-time option `--enable-force-getenv` to use `getenv` instead 24 of `secure_getenv`. (@interwq: 481bbfc9) 25 - Add compile-time option `--disable-dss` to disable the usage of 26 `sbrk(2)`. (@Svetlitski: ea5b7bea) 27 - Add runtime option `tcache_ncached_max` to control the number of items 28 in each size bin in the thread cache. (@guangli-dai: 8a22d10b) 29 - Add runtime option `calloc_madvise_threshold` to determine if kernel or 30 memset is used to zero the allocations for calloc. (@nullptr0-0: 31 5081c16b) 32 - Add compile-time option `--disable-user-config` to disable reading the 33 runtime configurations from `/etc/malloc.conf` or environment variable 34 `MALLOC_CONF`. (@roblabla: c17bf8b3) 35 - Add runtime option `disable_large_size_classes` to guard the new usable 36 size calculation, which minimizes the memory overhead for large 37 allocations, i.e., >= 4 * PAGE. (@guangli-dai: c067a55c, 8347f104) 38 - Enable process_madvise usage, add runtime option 39 `process_madvise_max_batch` to control the max # of regions in each 40 madvise batch. (@interwq: 22440a02, @spredolac: 4246475b) 41 - Add mallctl interfaces: 42 + `opt.prof_bt_max` (@guangli-dai: a0734fd6) 43 + `arena.<i>.name` to set and get arena names. (@guangli-dai: ba19d2cb) 44 + `thread.tcache.max` to set and get the `tcache_max` of the current 45 thread. (@guangli-dai: a442d9b8) 46 + `thread.tcache.ncached_max.write` and 47 `thread.tcache.ncached_max.read_sizeclass` to set and get the 48 `ncached_max` setup of the current thread. (@guangli-dai: 630f7de9, 49 6b197fdd) 50 + `arenas.hugepage` to return the hugepage size used, also exported to 51 malloc stats. (@ilvokhin: 90c627ed) 52 + `approximate_stats.active` to return an estimate of the current active 53 bytes, which should not be compared with other stats retrieved. 54 (@guangli-dai: 0988583d) 55 56 Bug fixes: 57 - Prevent potential deadlocks in decaying during reentrancy. (@interwq: 58 434a68e2) 59 - Fix segfault in extent coalescing. (@Svetlitski: 12311fe6) 60 - Add null pointer detections in mallctl calls. (@Svetlitski: dc0a184f, 61 0288126d) 62 - Make mallctl `arenas.lookup` triable without crashing on invalid 63 pointers. (@auxten: 019cccc2, 5bac3849) 64 - Demote sampled allocations for proper deallocations during 65 `arena_reset`. (@Svetlitski: 62648c88) 66 - Fix jemalloc's `read(2)` and `write(2)`. (@Svetlitski: d2c9ed3d, @lexprfuncall: 67 9fdc1160) 68 - Fix the pkg-config metadata file. (@BtbN: ed7e6fe7, ce8ce99a) 69 - Fix the autogen.sh so that it accepts quoted extra options. 70 (@honggyukim: f6fe6abd) 71 - Fix `rallocx()` to set errno to ENOMEM upon OOMing. (@arter97: 38056fea, 72 @interwq: 83b07578) 73 - Avoid stack overflow for internal variable array usage. (@nullptr0-0: 74 47c9bcd4, 48f66cf4, @xinydev: 9169e927) 75 - Fix background thread initialization race. (@puzpuzpuz: 4d0ffa07) 76 - Guard os_page_id against a NULL address. (@lexprfuncall: 79cc7dcc) 77 - Handle tcache init failures gracefully. (@lexprfuncall: a056c20d) 78 - Fix missing release of acquired neighbor edata in 79 extent_try_coalesce_impl. (@spredolac: 675ab079) 80 - Fix memory leak of old curr_reg on san_bump_grow_locked failure. 81 (@spredolac: 5904a421) 82 - Fix large alloc nrequests under-counting on cache misses. (@spredolac: 83 3cc56d32) 84 85 Portability improvements: 86 - Fix the build in C99. (@abaelhe: 56ddbea2) 87 - Add `pthread_setaffinity_np` detection for non Linux/BSD platforms. 88 (@devnexen: 4c95c953) 89 - Make `VARIABLE_ARRAY` compatible with compilers not supporting VLA, 90 i.e., Visual Studio C compiler in C11 or C17 modes. (@madscientist: 91 be65438f) 92 - Fix the build on Linux using musl library. (@marv: aba1645f, 45249cf5) 93 - Reduce the memory overhead in small allocation sampling for systems 94 with larger page sizes, e.g., ARM. (@Svetlitski: 5a858c64) 95 - Add C23's `free_sized` and `free_aligned_sized`. (@Svetlitski: 96 cdb2c0e0) 97 - Enable heap profiling on MacOS. (@nullptr0-0: 4b555c11) 98 - Fix incorrect printing on 32bit. (@sundb: 630434bb) 99 - Make `JEMALLOC_CXX_THROW` compatible with C++ versions newer than 100 C++17. (@r-barnes, @guangli-dai: 21bcc0a8) 101 - Fix mmap tag conflicts on MacOS. (@kdrag0n: c893fcd1) 102 - Fix monotonic timer assumption for win32. (@burtonli: 8dc97b11) 103 - Fix VM over-reservation on systems with larger pages, e.g., aarch64. 104 (@interwq: cd05b19f) 105 - Remove `unreachable()` macro conditionally to prevent definition 106 conflicts for C23+. (@appujee: d8486b26, 4b88bddb) 107 - Fix dlsym failure observed on FreeBSD. (@rhelmot: 86bbabac) 108 - Change the default page size to 64KB on aarch64 Linux. (@lexprfuncall: 109 9442300c) 110 - Update config.guess and config.sub to the latest version. 111 (@lexprfuncall: c51949ea) 112 - Determine the page size on Android from NDK header files. 113 (@lexprfuncall: c51abba1) 114 - Improve the portability of grep patterns in configure.ac. 115 (@lexprfuncall: 365747bc) 116 - Add compile-time option `--with-cxx-stdlib` to specify the C++ standard 117 library. (@yuxuanchen1997: a10ef3e1) 118 119 Optimizations and refactors: 120 - Enable tcache for deallocation-only threads. (@interwq: 143e9c4a) 121 - Inline to accelerate operator delete. (@guangli-dai: e8f9f138) 122 - Optimize pairing heap's performance. (@deadalnix: 5266152d, be6da4f6, 123 543e2d61, 10d71315, 92aa52c0, @Svetlitski: 36ca0c1b) 124 - Inline the storage for thread name in the profiling data. (@interwq: 125 ce0b7ab6, e62aa478) 126 - Optimize a hot function `edata_cmp_summary_comp` to accelerate it. 127 (@Svetlitski: 6841110b, @guangli-dai: 0181aaa4) 128 - Allocate thread cache using the base allocator, which enables thread 129 cache to use thp when `metadata_thp` is turned on. (@interwq: 130 72cfdce7) 131 - Allow oversize arena not to purge immediately when background threads 132 are enabled, although the default decay time is 0 to be back compatible. 133 (@interwq: d1313313) 134 - Optimize thread-local storage implementation on Windows. (@mcfi: 135 9e123a83, 3a0d9cda) 136 - Optimize fast path to allow static size class computation. (@interwq: 137 323ed2e3) 138 - Redesign tcache GC to regulate the frequency and make it 139 locality-aware. The new design is default on, guarded by option 140 `experimental_tcache_gc`. (@nullptr0-0: 0c88be9e, e2c9f3a9, 141 14d5dc13, @deadalnix: 5afff2e4) 142 - Reduce the arena switching overhead by avoiding forced purging when 143 background thread is enabled. (@interwq: a3910b98) 144 - Improve the reuse efficiency by limiting the maximum coalesced size for 145 large extents. (@jiebinn: 3c14707b) 146 - Refactor thread events to allow registration of users' thread events 147 and remove prof_threshold as the built-in event. (@spredolac: e6864c60, 148 015b0179, 34ace916) 149 150 Documentation: 151 - Update Windows building instructions. (@Lapenkov: 37139328) 152 - Add vcpkg installation instructions. (@LilyWangLL: c0c9783e) 153 - Update profiling internals with an example. (@jordalgo: b04e7666) 154 155 * 5.3.0 (May 6, 2022) 156 157 This release contains many speed and space optimizations, from micro 158 optimizations on common paths to rework of internal data structures and 159 locking schemes, and many more too detailed to list below. Multiple percent 160 of system level metric improvements were measured in tested production 161 workloads. The release has gone through large-scale production testing. 162 163 New features: 164 - Add the thread.idle mallctl which hints that the calling thread will be 165 idle for a nontrivial period of time. (@davidtgoldblatt) 166 - Allow small size classes to be the maximum size class to cache in the 167 thread-specific cache, through the opt.[lg_]tcache_max option. (@interwq, 168 @jordalgo) 169 - Make the behavior of realloc(ptr, 0) configurable with opt.zero_realloc. 170 (@davidtgoldblatt) 171 - Add 'make uninstall' support. (@sangshuduo, @Lapenkov) 172 - Support C++17 over-aligned allocation. (@marksantaniello) 173 - Add the thread.peak mallctl for approximate per-thread peak memory tracking. 174 (@davidtgoldblatt) 175 - Add interval-based stats output opt.stats_interval. (@interwq) 176 - Add prof.prefix to override filename prefixes for dumps. (@zhxchen17) 177 - Add high resolution timestamp support for profiling. (@tyroguru) 178 - Add the --collapsed flag to jeprof for flamegraph generation. 179 (@igorwwwwwwwwwwwwwwwwwwww) 180 - Add the --debug-syms-by-id option to jeprof for debug symbols discovery. 181 (@DeannaGelbart) 182 - Add the opt.prof_leak_error option to exit with error code when leak is 183 detected using opt.prof_final. (@yunxuo) 184 - Add opt.cache_oblivious as an runtime alternative to config.cache_oblivious. 185 (@interwq) 186 - Add mallctl interfaces: 187 + opt.zero_realloc (@davidtgoldblatt) 188 + opt.cache_oblivious (@interwq) 189 + opt.prof_leak_error (@yunxuo) 190 + opt.stats_interval (@interwq) 191 + opt.stats_interval_opts (@interwq) 192 + opt.tcache_max (@interwq) 193 + opt.trust_madvise (@azat) 194 + prof.prefix (@zhxchen17) 195 + stats.zero_reallocs (@davidtgoldblatt) 196 + thread.idle (@davidtgoldblatt) 197 + thread.peak.{read,reset} (@davidtgoldblatt) 198 199 Bug fixes: 200 - Fix the synchronization around explicit tcache creation which could cause 201 invalid tcache identifiers. This regression was first released in 5.0.0. 202 (@yoshinorim, @davidtgoldblatt) 203 - Fix a profiling biasing issue which could cause incorrect heap usage and 204 object counts. This issue existed in all previous releases with the heap 205 profiling feature. (@davidtgoldblatt) 206 - Fix the order of stats counter updating on large realloc which could cause 207 failed assertions. This regression was first released in 5.0.0. (@azat) 208 - Fix the locking on the arena destroy mallctl, which could cause concurrent 209 arena creations to fail. This functionality was first introduced in 5.0.0. 210 (@interwq) 211 212 Portability improvements: 213 - Remove nothrow from system function declarations on macOS and FreeBSD. 214 (@davidtgoldblatt, @fredemmott, @leres) 215 - Improve overcommit and page alignment settings on NetBSD. (@zoulasc) 216 - Improve CPU affinity support on BSD platforms. (@devnexen) 217 - Improve utrace detection and support. (@devnexen) 218 - Improve QEMU support with MADV_DONTNEED zeroed pages detection. (@azat) 219 - Add memcntl support on Solaris / illumos. (@devnexen) 220 - Improve CPU_SPINWAIT on ARM. (@AWSjswinney) 221 - Improve TSD cleanup on FreeBSD. (@Lapenkov) 222 - Disable percpu_arena if the CPU count cannot be reliably detected. (@azat) 223 - Add malloc_size(3) override support. (@devnexen) 224 - Add mmap VM_MAKE_TAG support. (@devnexen) 225 - Add support for MADV_[NO]CORE. (@devnexen) 226 - Add support for DragonFlyBSD. (@devnexen) 227 - Fix the QUANTUM setting on MIPS64. (@brooksdavis) 228 - Add the QUANTUM setting for ARC. (@vineetgarc) 229 - Add the QUANTUM setting for LoongArch. (@wangjl-uos) 230 - Add QNX support. (@jqian-aurora) 231 - Avoid atexit(3) calls unless the relevant profiling features are enabled. 232 (@BusyJay, @laiwei-rice, @interwq) 233 - Fix unknown option detection when using Clang. (@Lapenkov) 234 - Fix symbol conflict with musl libc. (@georgthegreat) 235 - Add -Wimplicit-fallthrough checks. (@nickdesaulniers) 236 - Add __forceinline support on MSVC. (@santagada) 237 - Improve FreeBSD and Windows CI support. (@Lapenkov) 238 - Add CI support for PPC64LE architecture. (@ezeeyahoo) 239 240 Incompatible changes: 241 - Maximum size class allowed in tcache (opt.[lg_]tcache_max) now has an upper 242 bound of 8MiB. (@interwq) 243 244 Optimizations and refactors (@davidtgoldblatt, @Lapenkov, @interwq): 245 - Optimize the common cases of the thread cache operations. 246 - Optimize internal data structures, including RB tree and pairing heap. 247 - Optimize the internal locking on extent management. 248 - Extract and refactor the internal page allocator and interface modules. 249 250 Documentation: 251 - Fix doc build with --with-install-suffix. (@lawmurray, @interwq) 252 - Add PROFILING_INTERNALS.md. (@davidtgoldblatt) 253 - Ensure the proper order of doc building and installation. (@Mingli-Yu) 254 255 * 5.2.1 (August 5, 2019) 256 257 This release is primarily about Windows. A critical virtual memory leak is 258 resolved on all Windows platforms. The regression was present in all releases 259 since 5.0.0. 260 261 Bug fixes: 262 - Fix a severe virtual memory leak on Windows. This regression was first 263 released in 5.0.0. (@Ignition, @j0t, @frederik-h, @davidtgoldblatt, 264 @interwq) 265 - Fix size 0 handling in posix_memalign(). This regression was first released 266 in 5.2.0. (@interwq) 267 - Fix the prof_log unit test which may observe unexpected backtraces from 268 compiler optimizations. The test was first added in 5.2.0. (@marxin, 269 @gnzlbg, @interwq) 270 - Fix the declaration of the extent_avail tree. This regression was first 271 released in 5.1.0. (@zoulasc) 272 - Fix an incorrect reference in jeprof. This functionality was first released 273 in 3.0.0. (@prehistoric-penguin) 274 - Fix an assertion on the deallocation fast-path. This regression was first 275 released in 5.2.0. (@yinan1048576) 276 - Fix the TLS_MODEL attribute in headers. This regression was first released 277 in 5.0.0. (@zoulasc, @interwq) 278 279 Optimizations and refactors: 280 - Implement opt.retain on Windows and enable by default on 64-bit. (@interwq, 281 @davidtgoldblatt) 282 - Optimize away a branch on the operator delete[] path. (@mgrice) 283 - Add format annotation to the format generator function. (@zoulasc) 284 - Refactor and improve the size class header generation. (@yinan1048576) 285 - Remove best fit. (@djwatson) 286 - Avoid blocking on background thread locks for stats. (@oranagra, @interwq) 287 288 * 5.2.0 (April 2, 2019) 289 290 This release includes a few notable improvements, which are summarized below: 291 1) improved fast-path performance from the optimizations by @djwatson; 2) 292 reduced virtual memory fragmentation and metadata usage; and 3) bug fixes on 293 setting the number of background threads. In addition, peak / spike memory 294 usage is improved with certain allocation patterns. As usual, the release and 295 prior dev versions have gone through large-scale production testing. 296 297 New features: 298 - Implement oversize_threshold, which uses a dedicated arena for allocations 299 crossing the specified threshold to reduce fragmentation. (@interwq) 300 - Add extents usage information to stats. (@tyleretzel) 301 - Log time information for sampled allocations. (@tyleretzel) 302 - Support 0 size in sdallocx. (@djwatson) 303 - Output rate for certain counters in malloc_stats. (@zinoale) 304 - Add configure option --enable-readlinkat, which allows the use of readlinkat 305 over readlink. (@davidtgoldblatt) 306 - Add configure options --{enable,disable}-{static,shared} to allow not 307 building unwanted libraries. (@Ericson2314) 308 - Add configure option --disable-libdl to enable fully static builds. 309 (@interwq) 310 - Add mallctl interfaces: 311 + opt.oversize_threshold (@interwq) 312 + stats.arenas.<i>.extent_avail (@tyleretzel) 313 + stats.arenas.<i>.extents.<j>.n{dirty,muzzy,retained} (@tyleretzel) 314 + stats.arenas.<i>.extents.<j>.{dirty,muzzy,retained}_bytes 315 (@tyleretzel) 316 317 Portability improvements: 318 - Update MSVC builds. (@maksqwe, @rustyx) 319 - Workaround a compiler optimizer bug on s390x. (@rkmisra) 320 - Make use of pthread_set_name_np(3) on FreeBSD. (@trasz) 321 - Implement malloc_getcpu() to enable percpu_arena for windows. (@santagada) 322 - Link against -pthread instead of -lpthread. (@paravoid) 323 - Make background_thread not dependent on libdl. (@interwq) 324 - Add stringify to fix a linker directive issue on MSVC. (@daverigby) 325 - Detect and fall back when 8-bit atomics are unavailable. (@interwq) 326 - Fall back to the default pthread_create if dlsym(3) fails. (@interwq) 327 328 Optimizations and refactors: 329 - Refactor the TSD module. (@davidtgoldblatt) 330 - Avoid taking extents_muzzy mutex when muzzy is disabled. (@interwq) 331 - Avoid taking large_mtx for auto arenas on the tcache flush path. (@interwq) 332 - Optimize ixalloc by avoiding a size lookup. (@interwq) 333 - Implement opt.oversize_threshold which uses a dedicated arena for requests 334 crossing the threshold, also eagerly purges the oversize extents. Default 335 the threshold to 8 MiB. (@interwq) 336 - Clean compilation with -Wextra. (@gnzlbg, @jasone) 337 - Refactor the size class module. (@davidtgoldblatt) 338 - Refactor the stats emitter. (@tyleretzel) 339 - Optimize pow2_ceil. (@rkmisra) 340 - Avoid runtime detection of lazy purging on FreeBSD. (@trasz) 341 - Optimize mmap(2) alignment handling on FreeBSD. (@trasz) 342 - Improve error handling for THP state initialization. (@jsteemann) 343 - Rework the malloc() fast path. (@djwatson) 344 - Rework the free() fast path. (@djwatson) 345 - Refactor and optimize the tcache fill / flush paths. (@djwatson) 346 - Optimize sync / lwsync on PowerPC. (@chmeeedalf) 347 - Bypass extent_dalloc() when retain is enabled. (@interwq) 348 - Optimize the locking on large deallocation. (@interwq) 349 - Reduce the number of pages committed from sanity checking in debug build. 350 (@trasz, @interwq) 351 - Deprecate OSSpinLock. (@interwq) 352 - Lower the default number of background threads to 4 (when the feature 353 is enabled). (@interwq) 354 - Optimize the trylock spin wait. (@djwatson) 355 - Use arena index for arena-matching checks. (@interwq) 356 - Avoid forced decay on thread termination when using background threads. 357 (@interwq) 358 - Disable muzzy decay by default. (@djwatson, @interwq) 359 - Only initialize libgcc unwinder when profiling is enabled. (@paravoid, 360 @interwq) 361 362 Bug fixes (all only relevant to jemalloc 5.x): 363 - Fix background thread index issues with max_background_threads. (@djwatson, 364 @interwq) 365 - Fix stats output for opt.lg_extent_max_active_fit. (@interwq) 366 - Fix opt.prof_prefix initialization. (@davidtgoldblatt) 367 - Properly trigger decay on tcache destroy. (@interwq, @amosbird) 368 - Fix tcache.flush. (@interwq) 369 - Detect whether explicit extent zero out is necessary with huge pages or 370 custom extent hooks, which may change the purge semantics. (@interwq) 371 - Fix a side effect caused by extent_max_active_fit combined with decay-based 372 purging, where freed extents can accumulate and not be reused for an 373 extended period of time. (@interwq, @mpghf) 374 - Fix a missing unlock on extent register error handling. (@zoulasc) 375 376 Testing: 377 - Simplify the Travis script output. (@gnzlbg) 378 - Update the test scripts for FreeBSD. (@devnexen) 379 - Add unit tests for the producer-consumer pattern. (@interwq) 380 - Add Cirrus-CI config for FreeBSD builds. (@jasone) 381 - Add size-matching sanity checks on tcache flush. (@davidtgoldblatt, 382 @interwq) 383 384 Incompatible changes: 385 - Remove --with-lg-page-sizes. (@davidtgoldblatt) 386 387 Documentation: 388 - Attempt to build docs by default, however skip doc building when xsltproc 389 is missing. (@interwq, @cmuellner) 390 391 * 5.1.0 (May 4, 2018) 392 393 This release is primarily about fine-tuning, ranging from several new features 394 to numerous notable performance and portability enhancements. The release and 395 prior dev versions have been running in multiple large scale applications for 396 months, and the cumulative improvements are substantial in many cases. 397 398 Given the long and successful production runs, this release is likely a good 399 candidate for applications to upgrade, from both jemalloc 5.0 and before. For 400 performance-critical applications, the newly added TUNING.md provides 401 guidelines on jemalloc tuning. 402 403 New features: 404 - Implement transparent huge page support for internal metadata. (@interwq) 405 - Add opt.thp to allow enabling / disabling transparent huge pages for all 406 mappings. (@interwq) 407 - Add maximum background thread count option. (@djwatson) 408 - Allow prof_active to control opt.lg_prof_interval and prof.gdump. 409 (@interwq) 410 - Allow arena index lookup based on allocation addresses via mallctl. 411 (@lionkov) 412 - Allow disabling initial-exec TLS model. (@davidtgoldblatt, @KenMacD) 413 - Add opt.lg_extent_max_active_fit to set the max ratio between the size of 414 the active extent selected (to split off from) and the size of the requested 415 allocation. (@interwq, @davidtgoldblatt) 416 - Add retain_grow_limit to set the max size when growing virtual address 417 space. (@interwq) 418 - Add mallctl interfaces: 419 + arena.<i>.retain_grow_limit (@interwq) 420 + arenas.lookup (@lionkov) 421 + max_background_threads (@djwatson) 422 + opt.lg_extent_max_active_fit (@interwq) 423 + opt.max_background_threads (@djwatson) 424 + opt.metadata_thp (@interwq) 425 + opt.thp (@interwq) 426 + stats.metadata_thp (@interwq) 427 428 Portability improvements: 429 - Support GNU/kFreeBSD configuration. (@paravoid) 430 - Support m68k, nios2 and SH3 architectures. (@paravoid) 431 - Fall back to FD_CLOEXEC when O_CLOEXEC is unavailable. (@zonyitoo) 432 - Fix symbol listing for cross-compiling. (@tamird) 433 - Fix high bits computation on ARM. (@davidtgoldblatt, @paravoid) 434 - Disable the CPU_SPINWAIT macro for Power. (@davidtgoldblatt, @marxin) 435 - Fix MSVC 2015 & 2017 builds. (@rustyx) 436 - Improve RISC-V support. (@EdSchouten) 437 - Set name mangling script in strict mode. (@nicolov) 438 - Avoid MADV_HUGEPAGE on ARM. (@marxin) 439 - Modify configure to determine return value of strerror_r. 440 (@davidtgoldblatt, @cferris1000) 441 - Make sure CXXFLAGS is tested with CPP compiler. (@nehaljwani) 442 - Fix 32-bit build on MSVC. (@rustyx) 443 - Fix external symbol on MSVC. (@maksqwe) 444 - Avoid a printf format specifier warning. (@jasone) 445 - Add configure option --disable-initial-exec-tls which can allow jemalloc to 446 be dynamically loaded after program startup. (@davidtgoldblatt, @KenMacD) 447 - AArch64: Add ILP32 support. (@cmuellner) 448 - Add --with-lg-vaddr configure option to support cross compiling. 449 (@cmuellner, @davidtgoldblatt) 450 451 Optimizations and refactors: 452 - Improve active extent fit with extent_max_active_fit. This considerably 453 reduces fragmentation over time and improves virtual memory and metadata 454 usage. (@davidtgoldblatt, @interwq) 455 - Eagerly coalesce large extents to reduce fragmentation. (@interwq) 456 - sdallocx: only read size info when page aligned (i.e. possibly sampled), 457 which speeds up the sized deallocation path significantly. (@interwq) 458 - Avoid attempting new mappings for in place expansion with retain, since 459 it rarely succeeds in practice and causes high overhead. (@interwq) 460 - Refactor OOM handling in newImpl. (@wqfish) 461 - Add internal fine-grained logging functionality for debugging use. 462 (@davidtgoldblatt) 463 - Refactor arena / tcache interactions. (@davidtgoldblatt) 464 - Refactor extent management with dumpable flag. (@davidtgoldblatt) 465 - Add runtime detection of lazy purging. (@interwq) 466 - Use pairing heap instead of red-black tree for extents_avail. (@djwatson) 467 - Use sysctl on startup in FreeBSD. (@trasz) 468 - Use thread local prng state instead of atomic. (@djwatson) 469 - Make decay to always purge one more extent than before, because in 470 practice large extents are usually the ones that cross the decay threshold. 471 Purging the additional extent helps save memory as well as reduce VM 472 fragmentation. (@interwq) 473 - Fast division by dynamic values. (@davidtgoldblatt) 474 - Improve the fit for aligned allocation. (@interwq, @edwinsmith) 475 - Refactor extent_t bitpacking. (@rkmisra) 476 - Optimize the generated assembly for ticker operations. (@davidtgoldblatt) 477 - Convert stats printing to use a structured text emitter. (@davidtgoldblatt) 478 - Remove preserve_lru feature for extents management. (@djwatson) 479 - Consolidate two memory loads into one on the fast deallocation path. 480 (@davidtgoldblatt, @interwq) 481 482 Bug fixes (most of the issues are only relevant to jemalloc 5.0): 483 - Fix deadlock with multithreaded fork in OS X. (@davidtgoldblatt) 484 - Validate returned file descriptor before use. (@zonyitoo) 485 - Fix a few background thread initialization and shutdown issues. (@interwq) 486 - Fix an extent coalesce + decay race by taking both coalescing extents off 487 the LRU list. (@interwq) 488 - Fix potentially unbound increase during decay, caused by one thread keep 489 stashing memory to purge while other threads generating new pages. The 490 number of pages to purge is checked to prevent this. (@interwq) 491 - Fix a FreeBSD bootstrap assertion. (@strejda, @interwq) 492 - Handle 32 bit mutex counters. (@rkmisra) 493 - Fix a indexing bug when creating background threads. (@davidtgoldblatt, 494 @binliu19) 495 - Fix arguments passed to extent_init. (@yuleniwo, @interwq) 496 - Fix addresses used for ordering mutexes. (@rkmisra) 497 - Fix abort_conf processing during bootstrap. (@interwq) 498 - Fix include path order for out-of-tree builds. (@cmuellner) 499 500 Incompatible changes: 501 - Remove --disable-thp. (@interwq) 502 - Remove mallctl interfaces: 503 + config.thp (@interwq) 504 505 Documentation: 506 - Add TUNING.md. (@interwq, @davidtgoldblatt, @djwatson) 507 508 * 5.0.1 (July 1, 2017) 509 510 This bugfix release fixes several issues, most of which are obscure enough 511 that typical applications are not impacted. 512 513 Bug fixes: 514 - Update decay->nunpurged before purging, in order to avoid potential update 515 races and subsequent incorrect purging volume. (@interwq) 516 - Only abort on dlsym(3) error if the failure impacts an enabled feature (lazy 517 locking and/or background threads). This mitigates an initialization 518 failure bug for which we still do not have a clear reproduction test case. 519 (@interwq) 520 - Modify tsd management so that it neither crashes nor leaks if a thread's 521 only allocation activity is to call free() after TLS destructors have been 522 executed. This behavior was observed when operating with GNU libc, and is 523 unlikely to be an issue with other libc implementations. (@interwq) 524 - Mask signals during background thread creation. This prevents signals from 525 being inadvertently delivered to background threads. (@jasone, 526 @davidtgoldblatt, @interwq) 527 - Avoid inactivity checks within background threads, in order to prevent 528 recursive mutex acquisition. (@interwq) 529 - Fix extent_grow_retained() to use the specified hooks when the 530 arena.<i>.extent_hooks mallctl is used to override the default hooks. 531 (@interwq) 532 - Add missing reentrancy support for custom extent hooks which allocate. 533 (@interwq) 534 - Post-fork(2), re-initialize the list of tcaches associated with each arena 535 to contain no tcaches except the forking thread's. (@interwq) 536 - Add missing post-fork(2) mutex reinitialization for extent_grow_mtx. This 537 fixes potential deadlocks after fork(2). (@interwq) 538 - Enforce minimum autoconf version (currently 2.68), since 2.63 is known to 539 generate corrupt configure scripts. (@jasone) 540 - Ensure that the configured page size (--with-lg-page) is no larger than the 541 configured huge page size (--with-lg-hugepage). (@jasone) 542 543 * 5.0.0 (June 13, 2017) 544 545 Unlike all previous jemalloc releases, this release does not use naturally 546 aligned "chunks" for virtual memory management, and instead uses page-aligned 547 "extents". This change has few externally visible effects, but the internal 548 impacts are... extensive. Many other internal changes combine to make this 549 the most cohesively designed version of jemalloc so far, with ample 550 opportunity for further enhancements. 551 552 Continuous integration is now an integral aspect of development thanks to the 553 efforts of @davidtgoldblatt, and the dev branch tends to remain reasonably 554 stable on the tested platforms (Linux, FreeBSD, macOS, and Windows). As a 555 side effect the official release frequency may decrease over time. 556 557 New features: 558 - Implement optional per-CPU arena support; threads choose which arena to use 559 based on current CPU rather than on fixed thread-->arena associations. 560 (@interwq) 561 - Implement two-phase decay of unused dirty pages. Pages transition from 562 dirty-->muzzy-->clean, where the first phase transition relies on 563 madvise(... MADV_FREE) semantics, and the second phase transition discards 564 pages such that they are replaced with demand-zeroed pages on next access. 565 (@jasone) 566 - Increase decay time resolution from seconds to milliseconds. (@jasone) 567 - Implement opt-in per CPU background threads, and use them for asynchronous 568 decay-driven unused dirty page purging. (@interwq) 569 - Add mutex profiling, which collects a variety of statistics useful for 570 diagnosing overhead/contention issues. (@interwq) 571 - Add C++ new/delete operator bindings. (@djwatson) 572 - Support manually created arena destruction, such that all data and metadata 573 are discarded. Add MALLCTL_ARENAS_DESTROYED for accessing merged stats 574 associated with destroyed arenas. (@jasone) 575 - Add MALLCTL_ARENAS_ALL as a fixed index for use in accessing 576 merged/destroyed arena statistics via mallctl. (@jasone) 577 - Add opt.abort_conf to optionally abort if invalid configuration options are 578 detected during initialization. (@interwq) 579 - Add opt.stats_print_opts, so that e.g. JSON output can be selected for the 580 stats dumped during exit if opt.stats_print is true. (@jasone) 581 - Add --with-version=VERSION for use when embedding jemalloc into another 582 project's git repository. (@jasone) 583 - Add --disable-thp to support cross compiling. (@jasone) 584 - Add --with-lg-hugepage to support cross compiling. (@jasone) 585 - Add mallctl interfaces (various authors): 586 + background_thread 587 + opt.abort_conf 588 + opt.retain 589 + opt.percpu_arena 590 + opt.background_thread 591 + opt.{dirty,muzzy}_decay_ms 592 + opt.stats_print_opts 593 + arena.<i>.initialized 594 + arena.<i>.destroy 595 + arena.<i>.{dirty,muzzy}_decay_ms 596 + arena.<i>.extent_hooks 597 + arenas.{dirty,muzzy}_decay_ms 598 + arenas.bin.<i>.slab_size 599 + arenas.nlextents 600 + arenas.lextent.<i>.size 601 + arenas.create 602 + stats.background_thread.{num_threads,num_runs,run_interval} 603 + stats.mutexes.{ctl,background_thread,prof,reset}. 604 {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, 605 num_owner_switch} 606 + stats.arenas.<i>.{dirty,muzzy}_decay_ms 607 + stats.arenas.<i>.uptime 608 + stats.arenas.<i>.{pmuzzy,base,internal,resident} 609 + stats.arenas.<i>.{dirty,muzzy}_{npurge,nmadvise,purged} 610 + stats.arenas.<i>.bins.<j>.{nslabs,reslabs,curslabs} 611 + stats.arenas.<i>.bins.<j>.mutex. 612 {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, 613 num_owner_switch} 614 + stats.arenas.<i>.lextents.<j>.{nmalloc,ndalloc,nrequests,curlextents} 615 + stats.arenas.i.mutexes.{large,extent_avail,extents_dirty,extents_muzzy, 616 extents_retained,decay_dirty,decay_muzzy,base,tcache_list}. 617 {num_ops,num_spin_acq,num_wait,max_wait_time,total_wait_time,max_num_thds, 618 num_owner_switch} 619 620 Portability improvements: 621 - Improve reentrant allocation support, such that deadlock is less likely if 622 e.g. a system library call in turn allocates memory. (@davidtgoldblatt, 623 @interwq) 624 - Support static linking of jemalloc with glibc. (@djwatson) 625 626 Optimizations and refactors: 627 - Organize virtual memory as "extents" of virtual memory pages, rather than as 628 naturally aligned "chunks", and store all metadata in arbitrarily distant 629 locations. This reduces virtual memory external fragmentation, and will 630 interact better with huge pages (not yet explicitly supported). (@jasone) 631 - Fold large and huge size classes together; only small and large size classes 632 remain. (@jasone) 633 - Unify the allocation paths, and merge most fast-path branching decisions. 634 (@davidtgoldblatt, @interwq) 635 - Embed per thread automatic tcache into thread-specific data, which reduces 636 conditional branches and dereferences. Also reorganize tcache to increase 637 fast-path data locality. (@interwq) 638 - Rewrite atomics to closely model the C11 API, convert various 639 synchronization from mutex-based to atomic, and use the explicit memory 640 ordering control to resolve various hypothetical races without increasing 641 synchronization overhead. (@davidtgoldblatt) 642 - Extensively optimize rtree via various methods: 643 + Add multiple layers of rtree lookup caching, since rtree lookups are now 644 part of fast-path deallocation. (@interwq) 645 + Determine rtree layout at compile time. (@jasone) 646 + Make the tree shallower for common configurations. (@jasone) 647 + Embed the root node in the top-level rtree data structure, thus avoiding 648 one level of indirection. (@jasone) 649 + Further specialize leaf elements as compared to internal node elements, 650 and directly embed extent metadata needed for fast-path deallocation. 651 (@jasone) 652 + Ignore leading always-zero address bits (architecture-specific). 653 (@jasone) 654 - Reorganize headers (ongoing work) to make them hermetic, and disentangle 655 various module dependencies. (@davidtgoldblatt) 656 - Convert various internal data structures such as size class metadata from 657 boot-time-initialized to compile-time-initialized. Propagate resulting data 658 structure simplifications, such as making arena metadata fixed-size. 659 (@jasone) 660 - Simplify size class lookups when constrained to size classes that are 661 multiples of the page size. This speeds lookups, but the primary benefit is 662 complexity reduction in code that was the source of numerous regressions. 663 (@jasone) 664 - Lock individual extents when possible for localized extent operations, 665 rather than relying on a top-level arena lock. (@davidtgoldblatt, @jasone) 666 - Use first fit layout policy instead of best fit, in order to improve 667 packing. (@jasone) 668 - If munmap(2) is not in use, use an exponential series to grow each arena's 669 virtual memory, so that the number of disjoint virtual memory mappings 670 remains low. (@jasone) 671 - Implement per arena base allocators, so that arenas never share any virtual 672 memory pages. (@jasone) 673 - Automatically generate private symbol name mangling macros. (@jasone) 674 675 Incompatible changes: 676 - Replace chunk hooks with an expanded/normalized set of extent hooks. 677 (@jasone) 678 - Remove ratio-based purging. (@jasone) 679 - Remove --disable-tcache. (@jasone) 680 - Remove --disable-tls. (@jasone) 681 - Remove --enable-ivsalloc. (@jasone) 682 - Remove --with-lg-size-class-group. (@jasone) 683 - Remove --with-lg-tiny-min. (@jasone) 684 - Remove --disable-cc-silence. (@jasone) 685 - Remove --enable-code-coverage. (@jasone) 686 - Remove --disable-munmap (replaced by opt.retain). (@jasone) 687 - Remove Valgrind support. (@jasone) 688 - Remove quarantine support. (@jasone) 689 - Remove redzone support. (@jasone) 690 - Remove mallctl interfaces (various authors): 691 + config.munmap 692 + config.tcache 693 + config.tls 694 + config.valgrind 695 + opt.lg_chunk 696 + opt.purge 697 + opt.lg_dirty_mult 698 + opt.decay_time 699 + opt.quarantine 700 + opt.redzone 701 + opt.thp 702 + arena.<i>.lg_dirty_mult 703 + arena.<i>.decay_time 704 + arena.<i>.chunk_hooks 705 + arenas.initialized 706 + arenas.lg_dirty_mult 707 + arenas.decay_time 708 + arenas.bin.<i>.run_size 709 + arenas.nlruns 710 + arenas.lrun.<i>.size 711 + arenas.nhchunks 712 + arenas.hchunk.<i>.size 713 + arenas.extend 714 + stats.cactive 715 + stats.arenas.<i>.lg_dirty_mult 716 + stats.arenas.<i>.decay_time 717 + stats.arenas.<i>.metadata.{mapped,allocated} 718 + stats.arenas.<i>.{npurge,nmadvise,purged} 719 + stats.arenas.<i>.huge.{allocated,nmalloc,ndalloc,nrequests} 720 + stats.arenas.<i>.bins.<j>.{nruns,reruns,curruns} 721 + stats.arenas.<i>.lruns.<j>.{nmalloc,ndalloc,nrequests,curruns} 722 + stats.arenas.<i>.hchunks.<j>.{nmalloc,ndalloc,nrequests,curhchunks} 723 724 Bug fixes: 725 - Improve interval-based profile dump triggering to dump only one profile when 726 a single allocation's size exceeds the interval. (@jasone) 727 - Use prefixed function names (as controlled by --with-jemalloc-prefix) when 728 pruning backtrace frames in jeprof. (@jasone) 729 730 * 4.5.0 (February 28, 2017) 731 732 This is the first release to benefit from much broader continuous integration 733 testing, thanks to @davidtgoldblatt. Had we had this testing infrastructure 734 in place for prior releases, it would have caught all of the most serious 735 regressions fixed by this release. 736 737 New features: 738 - Add --disable-thp and the opt.thp mallctl to provide opt-out mechanisms for 739 transparent huge page integration. (@jasone) 740 - Update zone allocator integration to work with macOS 10.12. (@glandium) 741 - Restructure *CFLAGS configuration, so that CFLAGS behaves typically, and 742 EXTRA_CFLAGS provides a way to specify e.g. -Werror during building, but not 743 during configuration. (@jasone, @ronawho) 744 745 Bug fixes: 746 - Fix DSS (sbrk(2)-based) allocation. This regression was first released in 747 4.3.0. (@jasone) 748 - Handle race in per size class utilization computation. This functionality 749 was first released in 4.0.0. (@interwq) 750 - Fix lock order reversal during gdump. (@jasone) 751 - Fix/refactor tcache synchronization. This regression was first released in 752 4.0.0. (@jasone) 753 - Fix various JSON-formatted malloc_stats_print() bugs. This functionality 754 was first released in 4.3.0. (@jasone) 755 - Fix huge-aligned allocation. This regression was first released in 4.4.0. 756 (@jasone) 757 - When transparent huge page integration is enabled, detect what state pages 758 start in according to the kernel's current operating mode, and only convert 759 arena chunks to non-huge during purging if that is not their initial state. 760 This functionality was first released in 4.4.0. (@jasone) 761 - Fix lg_chunk clamping for the --enable-cache-oblivious --disable-fill case. 762 This regression was first released in 4.0.0. (@jasone, @428desmo) 763 - Properly detect sparc64 when building for Linux. (@glaubitz) 764 765 * 4.4.0 (December 3, 2016) 766 767 New features: 768 - Add configure support for *-*-linux-android. (@cferris1000, @jasone) 769 - Add the --disable-syscall configure option, for use on systems that place 770 security-motivated limitations on syscall(2). (@jasone) 771 - Add support for Debian GNU/kFreeBSD. (@thesam) 772 773 Optimizations: 774 - Add extent serial numbers and use them where appropriate as a sort key that 775 is higher priority than address, so that the allocation policy prefers older 776 extents. This tends to improve locality (decrease fragmentation) when 777 memory grows downward. (@jasone) 778 - Refactor madvise(2) configuration so that MADV_FREE is detected and utilized 779 on Linux 4.5 and newer. (@jasone) 780 - Mark partially purged arena chunks as non-huge-page. This improves 781 interaction with Linux's transparent huge page functionality. (@jasone) 782 783 Bug fixes: 784 - Fix size class computations for edge conditions involving extremely large 785 allocations. This regression was first released in 4.0.0. (@jasone, 786 @ingvarha) 787 - Remove overly restrictive assertions related to the cactive statistic. This 788 regression was first released in 4.1.0. (@jasone) 789 - Implement a more reliable detection scheme for os_unfair_lock on macOS. 790 (@jszakmeister) 791 792 * 4.3.1 (November 7, 2016) 793 794 Bug fixes: 795 - Fix a severe virtual memory leak. This regression was first released in 796 4.3.0. (@interwq, @jasone) 797 - Refactor atomic and prng APIs to restore support for 32-bit platforms that 798 use pre-C11 toolchains, e.g. FreeBSD's mips. (@jasone) 799 800 * 4.3.0 (November 4, 2016) 801 802 This is the first release that passes the test suite for multiple Windows 803 configurations, thanks in large part to @glandium setting up continuous 804 integration via AppVeyor (and Travis CI for Linux and OS X). 805 806 New features: 807 - Add "J" (JSON) support to malloc_stats_print(). (@jasone) 808 - Add Cray compiler support. (@ronawho) 809 810 Optimizations: 811 - Add/use adaptive spinning for bootstrapping and radix tree node 812 initialization. (@jasone) 813 814 Bug fixes: 815 - Fix large allocation to search starting in the optimal size class heap, 816 which can substantially reduce virtual memory churn and fragmentation. This 817 regression was first released in 4.0.0. (@mjp41, @jasone) 818 - Fix stats.arenas.<i>.nthreads accounting. (@interwq) 819 - Fix and simplify decay-based purging. (@jasone) 820 - Make DSS (sbrk(2)-related) operations lockless, which resolves potential 821 deadlocks during thread exit. (@jasone) 822 - Fix over-sized allocation of radix tree leaf nodes. (@mjp41, @ogaun, 823 @jasone) 824 - Fix over-sized allocation of arena_t (plus associated stats) data 825 structures. (@jasone, @interwq) 826 - Fix EXTRA_CFLAGS to not affect configuration. (@jasone) 827 - Fix a Valgrind integration bug. (@ronawho) 828 - Disallow 0x5a junk filling when running in Valgrind. (@jasone) 829 - Fix a file descriptor leak on Linux. This regression was first released in 830 4.2.0. (@vsarunas, @jasone) 831 - Fix static linking of jemalloc with glibc. (@djwatson) 832 - Use syscall(2) rather than {open,read,close}(2) during boot on Linux. This 833 works around other libraries' system call wrappers performing reentrant 834 allocation. (@kspinka, @Whissi, @jasone) 835 - Fix OS X default zone replacement to work with OS X 10.12. (@glandium, 836 @jasone) 837 - Fix cached memory management to avoid needless commit/decommit operations 838 during purging, which resolves permanent virtual memory map fragmentation 839 issues on Windows. (@mjp41, @jasone) 840 - Fix TSD fetches to avoid (recursive) allocation. This is relevant to 841 non-TLS and Windows configurations. (@jasone) 842 - Fix malloc_conf overriding to work on Windows. (@jasone) 843 - Forcibly disable lazy-lock on Windows (was forcibly *enabled*). (@jasone) 844 845 * 4.2.1 (June 8, 2016) 846 847 Bug fixes: 848 - Fix bootstrapping issues for configurations that require allocation during 849 tsd initialization (e.g. --disable-tls). (@cferris1000, @jasone) 850 - Fix gettimeofday() version of nstime_update(). (@ronawho) 851 - Fix Valgrind regressions in calloc() and chunk_alloc_wrapper(). (@ronawho) 852 - Fix potential VM map fragmentation regression. (@jasone) 853 - Fix opt_zero-triggered in-place huge reallocation zeroing. (@jasone) 854 - Fix heap profiling context leaks in reallocation edge cases. (@jasone) 855 856 * 4.2.0 (May 12, 2016) 857 858 New features: 859 - Add the arena.<i>.reset mallctl, which makes it possible to discard all of 860 an arena's allocations in a single operation. (@jasone) 861 - Add the stats.retained and stats.arenas.<i>.retained statistics. (@jasone) 862 - Add the --with-version configure option. (@jasone) 863 - Support --with-lg-page values larger than actual page size. (@jasone) 864 865 Optimizations: 866 - Use pairing heaps rather than red-black trees for various hot data 867 structures. (@djwatson, @jasone) 868 - Streamline fast paths of rtree operations. (@jasone) 869 - Optimize the fast paths of calloc() and [m,d,sd]allocx(). (@jasone) 870 - Decommit unused virtual memory if the OS does not overcommit. (@jasone) 871 - Specify MAP_NORESERVE on Linux if [heuristic] overcommit is active, in order 872 to avoid unfortunate interactions during fork(2). (@jasone) 873 874 Bug fixes: 875 - Fix chunk accounting related to triggering gdump profiles. (@jasone) 876 - Link against librt for clock_gettime(2) if glibc < 2.17. (@jasone) 877 - Scale leak report summary according to sampling probability. (@jasone) 878 879 * 4.1.1 (May 3, 2016) 880 881 This bugfix release resolves a variety of mostly minor issues, though the 882 bitmap fix is critical for 64-bit Windows. 883 884 Bug fixes: 885 - Fix the linear scan version of bitmap_sfu() to shift by the proper amount 886 even when sizeof(long) is not the same as sizeof(void *), as on 64-bit 887 Windows. (@jasone) 888 - Fix hashing functions to avoid unaligned memory accesses (and resulting 889 crashes). This is relevant at least to some ARM-based platforms. 890 (@rkmisra) 891 - Fix fork()-related lock rank ordering reversals. These reversals were 892 unlikely to cause deadlocks in practice except when heap profiling was 893 enabled and active. (@jasone) 894 - Fix various chunk leaks in OOM code paths. (@jasone) 895 - Fix malloc_stats_print() to print opt.narenas correctly. (@jasone) 896 - Fix MSVC-specific build/test issues. (@rustyx, @yuslepukhin) 897 - Fix a variety of test failures that were due to test fragility rather than 898 core bugs. (@jasone) 899 900 * 4.1.0 (February 28, 2016) 901 902 This release is primarily about optimizations, but it also incorporates a lot 903 of portability-motivated refactoring and enhancements. Many people worked on 904 this release, to an extent that even with the omission here of minor changes 905 (see git revision history), and of the people who reported and diagnosed 906 issues, so much of the work was contributed that starting with this release, 907 changes are annotated with author credits to help reflect the collaborative 908 effort involved. 909 910 New features: 911 - Implement decay-based unused dirty page purging, a major optimization with 912 mallctl API impact. This is an alternative to the existing ratio-based 913 unused dirty page purging, and is intended to eventually become the sole 914 purging mechanism. New mallctls: 915 + opt.purge 916 + opt.decay_time 917 + arena.<i>.decay 918 + arena.<i>.decay_time 919 + arenas.decay_time 920 + stats.arenas.<i>.decay_time 921 (@jasone, @cevans87) 922 - Add --with-malloc-conf, which makes it possible to embed a default 923 options string during configuration. This was motivated by the desire to 924 specify --with-malloc-conf=purge:decay , since the default must remain 925 purge:ratio until the 5.0.0 release. (@jasone) 926 - Add MS Visual Studio 2015 support. (@rustyx, @yuslepukhin) 927 - Make *allocx() size class overflow behavior defined. The maximum 928 size class is now less than PTRDIFF_MAX to protect applications against 929 numerical overflow, and all allocation functions are guaranteed to indicate 930 errors rather than potentially crashing if the request size exceeds the 931 maximum size class. (@jasone) 932 - jeprof: 933 + Add raw heap profile support. (@jasone) 934 + Add --retain and --exclude for backtrace symbol filtering. (@jasone) 935 936 Optimizations: 937 - Optimize the fast path to combine various bootstrapping and configuration 938 checks and execute more streamlined code in the common case. (@interwq) 939 - Use linear scan for small bitmaps (used for small object tracking). In 940 addition to speeding up bitmap operations on 64-bit systems, this reduces 941 allocator metadata overhead by approximately 0.2%. (@djwatson) 942 - Separate arena_avail trees, which substantially speeds up run tree 943 operations. (@djwatson) 944 - Use memoization (boot-time-computed table) for run quantization. Separate 945 arena_avail trees reduced the importance of this optimization. (@jasone) 946 - Attempt mmap-based in-place huge reallocation. This can dramatically speed 947 up incremental huge reallocation. (@jasone) 948 949 Incompatible changes: 950 - Make opt.narenas unsigned rather than size_t. (@jasone) 951 952 Bug fixes: 953 - Fix stats.cactive accounting regression. (@rustyx, @jasone) 954 - Handle unaligned keys in hash(). This caused problems for some ARM systems. 955 (@jasone, @cferris1000) 956 - Refactor arenas array. In addition to fixing a fork-related deadlock, this 957 makes arena lookups faster and simpler. (@jasone) 958 - Move retained memory allocation out of the default chunk allocation 959 function, to a location that gets executed even if the application installs 960 a custom chunk allocation function. This resolves a virtual memory leak. 961 (@buchgr) 962 - Fix a potential tsd cleanup leak. (@cferris1000, @jasone) 963 - Fix run quantization. In practice this bug had no impact unless 964 applications requested memory with alignment exceeding one page. 965 (@jasone, @djwatson) 966 - Fix LinuxThreads-specific bootstrapping deadlock. (Cosmin Paraschiv) 967 - jeprof: 968 + Don't discard curl options if timeout is not defined. (@djwatson) 969 + Detect failed profile fetches. (@djwatson) 970 - Fix stats.arenas.<i>.{dss,lg_dirty_mult,decay_time,pactive,pdirty} for 971 --disable-stats case. (@jasone) 972 973 * 4.0.4 (October 24, 2015) 974 975 This bugfix release fixes another xallocx() regression. No other regressions 976 have come to light in over a month, so this is likely a good starting point 977 for people who prefer to wait for "dot one" releases with all the major issues 978 shaken out. 979 980 Bug fixes: 981 - Fix xallocx(..., MALLOCX_ZERO to zero the last full trailing page of large 982 allocations that have been randomly assigned an offset of 0 when 983 --enable-cache-oblivious configure option is enabled. 984 985 * 4.0.3 (September 24, 2015) 986 987 This bugfix release continues the trend of xallocx() and heap profiling fixes. 988 989 Bug fixes: 990 - Fix xallocx(..., MALLOCX_ZERO) to zero all trailing bytes of large 991 allocations when --enable-cache-oblivious configure option is enabled. 992 - Fix xallocx(..., MALLOCX_ZERO) to zero trailing bytes of huge allocations 993 when resizing from/to a size class that is not a multiple of the chunk size. 994 - Fix prof_tctx_dump_iter() to filter out nodes that were created after heap 995 profile dumping started. 996 - Work around a potentially bad thread-specific data initialization 997 interaction with NPTL (glibc's pthreads implementation). 998 999 * 4.0.2 (September 21, 2015) 1000 1001 This bugfix release addresses a few bugs specific to heap profiling. 1002 1003 Bug fixes: 1004 - Fix ixallocx_prof_sample() to never modify nor create sampled small 1005 allocations. xallocx() is in general incapable of moving small allocations, 1006 so this fix removes buggy code without loss of generality. 1007 - Fix irallocx_prof_sample() to always allocate large regions, even when 1008 alignment is non-zero. 1009 - Fix prof_alloc_rollback() to read tdata from thread-specific data rather 1010 than dereferencing a potentially invalid tctx. 1011 1012 * 4.0.1 (September 15, 2015) 1013 1014 This is a bugfix release that is somewhat high risk due to the amount of 1015 refactoring required to address deep xallocx() problems. As a side effect of 1016 these fixes, xallocx() now tries harder to partially fulfill requests for 1017 optional extra space. Note that a couple of minor heap profiling 1018 optimizations are included, but these are better thought of as performance 1019 fixes that were integral to discovering most of the other bugs. 1020 1021 Optimizations: 1022 - Avoid a chunk metadata read in arena_prof_tctx_set(), since it is in the 1023 fast path when heap profiling is enabled. Additionally, split a special 1024 case out into arena_prof_tctx_reset(), which also avoids chunk metadata 1025 reads. 1026 - Optimize irallocx_prof() to optimistically update the sampler state. The 1027 prior implementation appears to have been a holdover from when 1028 rallocx()/xallocx() functionality was combined as rallocm(). 1029 1030 Bug fixes: 1031 - Fix TLS configuration such that it is enabled by default for platforms on 1032 which it works correctly. 1033 - Fix arenas_cache_cleanup() and arena_get_hard() to handle 1034 allocation/deallocation within the application's thread-specific data 1035 cleanup functions even after arenas_cache is torn down. 1036 - Fix xallocx() bugs related to size+extra exceeding HUGE_MAXCLASS. 1037 - Fix chunk purge hook calls for in-place huge shrinking reallocation to 1038 specify the old chunk size rather than the new chunk size. This bug caused 1039 no correctness issues for the default chunk purge function, but was 1040 visible to custom functions set via the "arena.<i>.chunk_hooks" mallctl. 1041 - Fix heap profiling bugs: 1042 + Fix heap profiling to distinguish among otherwise identical sample sites 1043 with interposed resets (triggered via the "prof.reset" mallctl). This bug 1044 could cause data structure corruption that would most likely result in a 1045 segfault. 1046 + Fix irealloc_prof() to prof_alloc_rollback() on OOM. 1047 + Make one call to prof_active_get_unlocked() per allocation event, and use 1048 the result throughout the relevant functions that handle an allocation 1049 event. Also add a missing check in prof_realloc(). These fixes protect 1050 allocation events against concurrent prof_active changes. 1051 + Fix ixallocx_prof() to pass usize_max and zero to ixallocx_prof_sample() 1052 in the correct order. 1053 + Fix prof_realloc() to call prof_free_sampled_object() after calling 1054 prof_malloc_sample_object(). Prior to this fix, if tctx and old_tctx were 1055 the same, the tctx could have been prematurely destroyed. 1056 - Fix portability bugs: 1057 + Don't bitshift by negative amounts when encoding/decoding run sizes in 1058 chunk header maps. This affected systems with page sizes greater than 8 1059 KiB. 1060 + Rename index_t to szind_t to avoid an existing type on Solaris. 1061 + Add JEMALLOC_CXX_THROW to the memalign() function prototype, in order to 1062 match glibc and avoid compilation errors when including both 1063 jemalloc/jemalloc.h and malloc.h in C++ code. 1064 + Don't assume that /bin/sh is appropriate when running size_classes.sh 1065 during configuration. 1066 + Consider __sparcv9 a synonym for __sparc64__ when defining LG_QUANTUM. 1067 + Link tests to librt if it contains clock_gettime(2). 1068 1069 * 4.0.0 (August 17, 2015) 1070 1071 This version contains many speed and space optimizations, both minor and 1072 major. The major themes are generalization, unification, and simplification. 1073 Although many of these optimizations cause no visible behavior change, their 1074 cumulative effect is substantial. 1075 1076 New features: 1077 - Normalize size class spacing to be consistent across the complete size 1078 range. By default there are four size classes per size doubling, but this 1079 is now configurable via the --with-lg-size-class-group option. Also add the 1080 --with-lg-page, --with-lg-page-sizes, --with-lg-quantum, and 1081 --with-lg-tiny-min options, which can be used to tweak page and size class 1082 settings. Impacts: 1083 + Worst case performance for incrementally growing/shrinking reallocation 1084 is improved because there are far fewer size classes, and therefore 1085 copying happens less often. 1086 + Internal fragmentation is limited to 20% for all but the smallest size 1087 classes (those less than four times the quantum). (1B + 4 KiB) 1088 and (1B + 4 MiB) previously suffered nearly 50% internal fragmentation. 1089 + Chunk fragmentation tends to be lower because there are fewer distinct run 1090 sizes to pack. 1091 - Add support for explicit tcaches. The "tcache.create", "tcache.flush", and 1092 "tcache.destroy" mallctls control tcache lifetime and flushing, and the 1093 MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to the *allocx() API 1094 control which tcache is used for each operation. 1095 - Implement per thread heap profiling, as well as the ability to 1096 enable/disable heap profiling on a per thread basis. Add the "prof.reset", 1097 "prof.lg_sample", "thread.prof.name", "thread.prof.active", 1098 "opt.prof_thread_active_init", "prof.thread_active_init", and 1099 "thread.prof.active" mallctls. 1100 - Add support for per arena application-specified chunk allocators, configured 1101 via the "arena.<i>.chunk_hooks" mallctl. 1102 - Refactor huge allocation to be managed by arenas, so that arenas now 1103 function as general purpose independent allocators. This is important in 1104 the context of user-specified chunk allocators, aside from the scalability 1105 benefits. Related new statistics: 1106 + The "stats.arenas.<i>.huge.allocated", "stats.arenas.<i>.huge.nmalloc", 1107 "stats.arenas.<i>.huge.ndalloc", and "stats.arenas.<i>.huge.nrequests" 1108 mallctls provide high level per arena huge allocation statistics. 1109 + The "arenas.nhchunks", "arenas.hchunk.<i>.size", 1110 "stats.arenas.<i>.hchunks.<j>.nmalloc", 1111 "stats.arenas.<i>.hchunks.<j>.ndalloc", 1112 "stats.arenas.<i>.hchunks.<j>.nrequests", and 1113 "stats.arenas.<i>.hchunks.<j>.curhchunks" mallctls provide per size class 1114 statistics. 1115 - Add the 'util' column to malloc_stats_print() output, which reports the 1116 proportion of available regions that are currently in use for each small 1117 size class. 1118 - Add "alloc" and "free" modes for for junk filling (see the "opt.junk" 1119 mallctl), so that it is possible to separately enable junk filling for 1120 allocation versus deallocation. 1121 - Add the jemalloc-config script, which provides information about how 1122 jemalloc was configured, and how to integrate it into application builds. 1123 - Add metadata statistics, which are accessible via the "stats.metadata", 1124 "stats.arenas.<i>.metadata.mapped", and 1125 "stats.arenas.<i>.metadata.allocated" mallctls. 1126 - Add the "stats.resident" mallctl, which reports the upper limit of 1127 physically resident memory mapped by the allocator. 1128 - Add per arena control over unused dirty page purging, via the 1129 "arenas.lg_dirty_mult", "arena.<i>.lg_dirty_mult", and 1130 "stats.arenas.<i>.lg_dirty_mult" mallctls. 1131 - Add the "prof.gdump" mallctl, which makes it possible to toggle the gdump 1132 feature on/off during program execution. 1133 - Add sdallocx(), which implements sized deallocation. The primary 1134 optimization over dallocx() is the removal of a metadata read, which often 1135 suffers an L1 cache miss. 1136 - Add missing header includes in jemalloc/jemalloc.h, so that applications 1137 only have to #include <jemalloc/jemalloc.h>. 1138 - Add support for additional platforms: 1139 + Bitrig 1140 + Cygwin 1141 + DragonFlyBSD 1142 + iOS 1143 + OpenBSD 1144 + OpenRISC/or1k 1145 1146 Optimizations: 1147 - Maintain dirty runs in per arena LRUs rather than in per arena trees of 1148 dirty-run-containing chunks. In practice this change significantly reduces 1149 dirty page purging volume. 1150 - Integrate whole chunks into the unused dirty page purging machinery. This 1151 reduces the cost of repeated huge allocation/deallocation, because it 1152 effectively introduces a cache of chunks. 1153 - Split the arena chunk map into two separate arrays, in order to increase 1154 cache locality for the frequently accessed bits. 1155 - Move small run metadata out of runs, into arena chunk headers. This reduces 1156 run fragmentation, smaller runs reduce external fragmentation for small size 1157 classes, and packed (less uniformly aligned) metadata layout improves CPU 1158 cache set distribution. 1159 - Randomly distribute large allocation base pointer alignment relative to page 1160 boundaries in order to more uniformly utilize CPU cache sets. This can be 1161 disabled via the --disable-cache-oblivious configure option, and queried via 1162 the "config.cache_oblivious" mallctl. 1163 - Micro-optimize the fast paths for the public API functions. 1164 - Refactor thread-specific data to reside in a single structure. This assures 1165 that only a single TLS read is necessary per call into the public API. 1166 - Implement in-place huge allocation growing and shrinking. 1167 - Refactor rtree (radix tree for chunk lookups) to be lock-free, and make 1168 additional optimizations that reduce maximum lookup depth to one or two 1169 levels. This resolves what was a concurrency bottleneck for per arena huge 1170 allocation, because a global data structure is critical for determining 1171 which arenas own which huge allocations. 1172 1173 Incompatible changes: 1174 - Replace --enable-cc-silence with --disable-cc-silence to suppress spurious 1175 warnings by default. 1176 - Assure that the constness of malloc_usable_size()'s return type matches that 1177 of the system implementation. 1178 - Change the heap profile dump format to support per thread heap profiling, 1179 rename pprof to jeprof, and enhance it with the --thread=<n> option. As a 1180 result, the bundled jeprof must now be used rather than the upstream 1181 (gperftools) pprof. 1182 - Disable "opt.prof_final" by default, in order to avoid atexit(3), which can 1183 internally deadlock on some platforms. 1184 - Change the "arenas.nlruns" mallctl type from size_t to unsigned. 1185 - Replace the "stats.arenas.<i>.bins.<j>.allocated" mallctl with 1186 "stats.arenas.<i>.bins.<j>.curregs". 1187 - Ignore MALLOC_CONF in set{uid,gid,cap} binaries. 1188 - Ignore MALLOCX_ARENA(a) in dallocx(), in favor of using the 1189 MALLOCX_TCACHE(tc) and MALLOCX_TCACHE_NONE flags to control tcache usage. 1190 1191 Removed features: 1192 - Remove the *allocm() API, which is superseded by the *allocx() API. 1193 - Remove the --enable-dss options, and make dss non-optional on all platforms 1194 which support sbrk(2). 1195 - Remove the "arenas.purge" mallctl, which was obsoleted by the 1196 "arena.<i>.purge" mallctl in 3.1.0. 1197 - Remove the unnecessary "opt.valgrind" mallctl; jemalloc automatically 1198 detects whether it is running inside Valgrind. 1199 - Remove the "stats.huge.allocated", "stats.huge.nmalloc", and 1200 "stats.huge.ndalloc" mallctls. 1201 - Remove the --enable-mremap option. 1202 - Remove the "stats.chunks.current", "stats.chunks.total", and 1203 "stats.chunks.high" mallctls. 1204 1205 Bug fixes: 1206 - Fix the cactive statistic to decrease (rather than increase) when active 1207 memory decreases. This regression was first released in 3.5.0. 1208 - Fix OOM handling in memalign() and valloc(). A variant of this bug existed 1209 in all releases since 2.0.0, which introduced these functions. 1210 - Fix an OOM-related regression in arena_tcache_fill_small(), which could 1211 cause cache corruption on OOM. This regression was present in all releases 1212 from 2.2.0 through 3.6.0. 1213 - Fix size class overflow handling for malloc(), posix_memalign(), memalign(), 1214 calloc(), and realloc() when profiling is enabled. 1215 - Fix the "arena.<i>.dss" mallctl to return an error if "primary" or 1216 "secondary" precedence is specified, but sbrk(2) is not supported. 1217 - Fix fallback lg_floor() implementations to handle extremely large inputs. 1218 - Ensure the default purgeable zone is after the default zone on OS X. 1219 - Fix latent bugs in atomic_*(). 1220 - Fix the "arena.<i>.dss" mallctl to handle read-only calls. 1221 - Fix tls_model configuration to enable the initial-exec model when possible. 1222 - Mark malloc_conf as a weak symbol so that the application can override it. 1223 - Correctly detect glibc's adaptive pthread mutexes. 1224 - Fix the --without-export configure option. 1225 1226 * 3.6.0 (March 31, 2014) 1227 1228 This version contains a critical bug fix for a regression present in 3.5.0 and 1229 3.5.1. 1230 1231 Bug fixes: 1232 - Fix a regression in arena_chunk_alloc() that caused crashes during 1233 small/large allocation if chunk allocation failed. In the absence of this 1234 bug, chunk allocation failure would result in allocation failure, e.g. NULL 1235 return from malloc(). This regression was introduced in 3.5.0. 1236 - Fix backtracing for gcc intrinsics-based backtracing by specifying 1237 -fno-omit-frame-pointer to gcc. Note that the application (and all the 1238 libraries it links to) must also be compiled with this option for 1239 backtracing to be reliable. 1240 - Use dss allocation precedence for huge allocations as well as small/large 1241 allocations. 1242 - Fix test assertion failure message formatting. This bug did not manifest on 1243 x86_64 systems because of implementation subtleties in va_list. 1244 - Fix inconsequential test failures for hash and SFMT code. 1245 1246 New features: 1247 - Support heap profiling on FreeBSD. This feature depends on the proc 1248 filesystem being mounted during heap profile dumping. 1249 1250 * 3.5.1 (February 25, 2014) 1251 1252 This version primarily addresses minor bugs in test code. 1253 1254 Bug fixes: 1255 - Configure Solaris/Illumos to use MADV_FREE. 1256 - Fix junk filling for mremap(2)-based huge reallocation. This is only 1257 relevant if configuring with the --enable-mremap option specified. 1258 - Avoid compilation failure if 'restrict' C99 keyword is not supported by the 1259 compiler. 1260 - Add a configure test for SSE2 rather than assuming it is usable on i686 1261 systems. This fixes test compilation errors, especially on 32-bit Linux 1262 systems. 1263 - Fix mallctl argument size mismatches (size_t vs. uint64_t) in the stats unit 1264 test. 1265 - Fix/remove flawed alignment-related overflow tests. 1266 - Prevent compiler optimizations that could change backtraces in the 1267 prof_accum unit test. 1268 1269 * 3.5.0 (January 22, 2014) 1270 1271 This version focuses on refactoring and automated testing, though it also 1272 includes some non-trivial heap profiling optimizations not mentioned below. 1273 1274 New features: 1275 - Add the *allocx() API, which is a successor to the experimental *allocm() 1276 API. The *allocx() functions are slightly simpler to use because they have 1277 fewer parameters, they directly return the results of primary interest, and 1278 mallocx()/rallocx() avoid the strict aliasing pitfall that 1279 allocm()/rallocm() share with posix_memalign(). Note that *allocm() is 1280 slated for removal in the next non-bugfix release. 1281 - Add support for LinuxThreads. 1282 1283 Bug fixes: 1284 - Unless heap profiling is enabled, disable floating point code and don't link 1285 with libm. This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64 1286 systems, makes it possible to completely disable floating point register 1287 use. Some versions of glibc neglect to save/restore caller-saved floating 1288 point registers during dynamic lazy symbol loading, and the symbol loading 1289 code uses whatever malloc the application happens to have linked/loaded 1290 with, the result being potential floating point register corruption. 1291 - Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling 1292 backtrace creation in imemalign(). This bug impacted posix_memalign() and 1293 aligned_alloc(). 1294 - Fix a file descriptor leak in a prof_dump_maps() error path. 1295 - Fix prof_dump() to close the dump file descriptor for all relevant error 1296 paths. 1297 - Fix rallocm() to use the arena specified by the ALLOCM_ARENA(s) flag for 1298 allocation, not just deallocation. 1299 - Fix a data race for large allocation stats counters. 1300 - Fix a potential infinite loop during thread exit. This bug occurred on 1301 Solaris, and could affect other platforms with similar pthreads TSD 1302 implementations. 1303 - Don't junk-fill reallocations unless usable size changes. This fixes a 1304 violation of the *allocx()/*allocm() semantics. 1305 - Fix growing large reallocation to junk fill new space. 1306 - Fix huge deallocation to junk fill when munmap is disabled. 1307 - Change the default private namespace prefix from empty to je_, and change 1308 --with-private-namespace-prefix so that it prepends an additional prefix 1309 rather than replacing je_. This reduces the likelihood of applications 1310 which statically link jemalloc experiencing symbol name collisions. 1311 - Add missing private namespace mangling (relevant when 1312 --with-private-namespace is specified). 1313 - Add and use JEMALLOC_INLINE_C so that static inline functions are marked as 1314 static even for debug builds. 1315 - Add a missing mutex unlock in a malloc_init_hard() error path. In practice 1316 this error path is never executed. 1317 - Fix numerous bugs in malloc_strotumax() error handling/reporting. These 1318 bugs had no impact except for malformed inputs. 1319 - Fix numerous bugs in malloc_snprintf(). These bugs were not exercised by 1320 existing calls, so they had no impact. 1321 1322 * 3.4.1 (October 20, 2013) 1323 1324 Bug fixes: 1325 - Fix a race in the "arenas.extend" mallctl that could cause memory corruption 1326 of internal data structures and subsequent crashes. 1327 - Fix Valgrind integration flaws that caused Valgrind warnings about reads of 1328 uninitialized memory in: 1329 + arena chunk headers 1330 + internal zero-initialized data structures (relevant to tcache and prof 1331 code) 1332 - Preserve errno during the first allocation. A readlink(2) call during 1333 initialization fails unless /etc/malloc.conf exists, so errno was typically 1334 set during the first allocation prior to this fix. 1335 - Fix compilation warnings reported by gcc 4.8.1. 1336 1337 * 3.4.0 (June 2, 2013) 1338 1339 This version is essentially a small bugfix release, but the addition of 1340 aarch64 support requires that the minor version be incremented. 1341 1342 Bug fixes: 1343 - Fix race-triggered deadlocks in chunk_record(). These deadlocks were 1344 typically triggered by multiple threads concurrently deallocating huge 1345 objects. 1346 1347 New features: 1348 - Add support for the aarch64 architecture. 1349 1350 * 3.3.1 (March 6, 2013) 1351 1352 This version fixes bugs that are typically encountered only when utilizing 1353 custom run-time options. 1354 1355 Bug fixes: 1356 - Fix a locking order bug that could cause deadlock during fork if heap 1357 profiling were enabled. 1358 - Fix a chunk recycling bug that could cause the allocator to lose track of 1359 whether a chunk was zeroed. On FreeBSD, NetBSD, and OS X, it could cause 1360 corruption if allocating via sbrk(2) (unlikely unless running with the 1361 "dss:primary" option specified). This was completely harmless on Linux 1362 unless using mlockall(2) (and unlikely even then, unless the 1363 --disable-munmap configure option or the "dss:primary" option was 1364 specified). This regression was introduced in 3.1.0 by the 1365 mlockall(2)/madvise(2) interaction fix. 1366 - Fix TLS-related memory corruption that could occur during thread exit if the 1367 thread never allocated memory. Only the quarantine and prof facilities were 1368 susceptible. 1369 - Fix two quarantine bugs: 1370 + Internal reallocation of the quarantined object array leaked the old 1371 array. 1372 + Reallocation failure for internal reallocation of the quarantined object 1373 array (very unlikely) resulted in memory corruption. 1374 - Fix Valgrind integration to annotate all internally allocated memory in a 1375 way that keeps Valgrind happy about internal data structure access. 1376 - Fix building for s390 systems. 1377 1378 * 3.3.0 (January 23, 2013) 1379 1380 This version includes a few minor performance improvements in addition to the 1381 listed new features and bug fixes. 1382 1383 New features: 1384 - Add clipping support to lg_chunk option processing. 1385 - Add the --enable-ivsalloc option. 1386 - Add the --without-export option. 1387 - Add the --disable-zone-allocator option. 1388 1389 Bug fixes: 1390 - Fix "arenas.extend" mallctl to output the number of arenas. 1391 - Fix chunk_recycle() to unconditionally inform Valgrind that returned memory 1392 is undefined. 1393 - Fix build break on FreeBSD related to alloca.h. 1394 1395 * 3.2.0 (November 9, 2012) 1396 1397 In addition to a couple of bug fixes, this version modifies page run 1398 allocation and dirty page purging algorithms in order to better control 1399 page-level virtual memory fragmentation. 1400 1401 Incompatible changes: 1402 - Change the "opt.lg_dirty_mult" default from 5 to 3 (32:1 to 8:1). 1403 1404 Bug fixes: 1405 - Fix dss/mmap allocation precedence code to use recyclable mmap memory only 1406 after primary dss allocation fails. 1407 - Fix deadlock in the "arenas.purge" mallctl. This regression was introduced 1408 in 3.1.0 by the addition of the "arena.<i>.purge" mallctl. 1409 1410 * 3.1.0 (October 16, 2012) 1411 1412 New features: 1413 - Auto-detect whether running inside Valgrind, thus removing the need to 1414 manually specify MALLOC_CONF=valgrind:true. 1415 - Add the "arenas.extend" mallctl, which allows applications to create 1416 manually managed arenas. 1417 - Add the ALLOCM_ARENA() flag for {,r,d}allocm(). 1418 - Add the "opt.dss", "arena.<i>.dss", and "stats.arenas.<i>.dss" mallctls, 1419 which provide control over dss/mmap precedence. 1420 - Add the "arena.<i>.purge" mallctl, which obsoletes "arenas.purge". 1421 - Define LG_QUANTUM for hppa. 1422 1423 Incompatible changes: 1424 - Disable tcache by default if running inside Valgrind, in order to avoid 1425 making unallocated objects appear reachable to Valgrind. 1426 - Drop const from malloc_usable_size() argument on Linux. 1427 1428 Bug fixes: 1429 - Fix heap profiling crash if sampled object is freed via realloc(p, 0). 1430 - Remove const from __*_hook variable declarations, so that glibc can modify 1431 them during process forking. 1432 - Fix mlockall(2)/madvise(2) interaction. 1433 - Fix fork(2)-related deadlocks. 1434 - Fix error return value for "thread.tcache.enabled" mallctl. 1435 1436 * 3.0.0 (May 11, 2012) 1437 1438 Although this version adds some major new features, the primary focus is on 1439 internal code cleanup that facilitates maintainability and portability, most 1440 of which is not reflected in the ChangeLog. This is the first release to 1441 incorporate substantial contributions from numerous other developers, and the 1442 result is a more broadly useful allocator (see the git revision history for 1443 contribution details). Note that the license has been unified, thanks to 1444 Facebook granting a license under the same terms as the other copyright 1445 holders (see COPYING). 1446 1447 New features: 1448 - Implement Valgrind support, redzones, and quarantine. 1449 - Add support for additional platforms: 1450 + FreeBSD 1451 + Mac OS X Lion 1452 + MinGW 1453 + Windows (no support yet for replacing the system malloc) 1454 - Add support for additional architectures: 1455 + MIPS 1456 + SH4 1457 + Tilera 1458 - Add support for cross compiling. 1459 - Add nallocm(), which rounds a request size up to the nearest size class 1460 without actually allocating. 1461 - Implement aligned_alloc() (blame C11). 1462 - Add the "thread.tcache.enabled" mallctl. 1463 - Add the "opt.prof_final" mallctl. 1464 - Update pprof (from gperftools 2.0). 1465 - Add the --with-mangling option. 1466 - Add the --disable-experimental option. 1467 - Add the --disable-munmap option, and make it the default on Linux. 1468 - Add the --enable-mremap option, which disables use of mremap(2) by default. 1469 1470 Incompatible changes: 1471 - Enable stats by default. 1472 - Enable fill by default. 1473 - Disable lazy locking by default. 1474 - Rename the "tcache.flush" mallctl to "thread.tcache.flush". 1475 - Rename the "arenas.pagesize" mallctl to "arenas.page". 1476 - Change the "opt.lg_prof_sample" default from 0 to 19 (1 B to 512 KiB). 1477 - Change the "opt.prof_accum" default from true to false. 1478 1479 Removed features: 1480 - Remove the swap feature, including the "config.swap", "swap.avail", 1481 "swap.prezeroed", "swap.nfds", and "swap.fds" mallctls. 1482 - Remove highruns statistics, including the 1483 "stats.arenas.<i>.bins.<j>.highruns" and 1484 "stats.arenas.<i>.lruns.<j>.highruns" mallctls. 1485 - As part of small size class refactoring, remove the "opt.lg_[qc]space_max", 1486 "arenas.cacheline", "arenas.subpage", "arenas.[tqcs]space_{min,max}", and 1487 "arenas.[tqcs]bins" mallctls. 1488 - Remove the "arenas.chunksize" mallctl. 1489 - Remove the "opt.lg_prof_tcmax" option. 1490 - Remove the "opt.lg_prof_bt_max" option. 1491 - Remove the "opt.lg_tcache_gc_sweep" option. 1492 - Remove the --disable-tiny option, including the "config.tiny" mallctl. 1493 - Remove the --enable-dynamic-page-shift configure option. 1494 - Remove the --enable-sysv configure option. 1495 1496 Bug fixes: 1497 - Fix a statistics-related bug in the "thread.arena" mallctl that could cause 1498 invalid statistics and crashes. 1499 - Work around TLS deallocation via free() on Linux. This bug could cause 1500 write-after-free memory corruption. 1501 - Fix a potential deadlock that could occur during interval- and 1502 growth-triggered heap profile dumps. 1503 - Fix large calloc() zeroing bugs due to dropping chunk map unzeroed flags. 1504 - Fix chunk_alloc_dss() to stop claiming memory is zeroed. This bug could 1505 cause memory corruption and crashes with --enable-dss specified. 1506 - Fix fork-related bugs that could cause deadlock in children between fork 1507 and exec. 1508 - Fix malloc_stats_print() to honor 'b' and 'l' in the opts parameter. 1509 - Fix realloc(p, 0) to act like free(p). 1510 - Do not enforce minimum alignment in memalign(). 1511 - Check for NULL pointer in malloc_usable_size(). 1512 - Fix an off-by-one heap profile statistics bug that could be observed in 1513 interval- and growth-triggered heap profiles. 1514 - Fix the "epoch" mallctl to update cached stats even if the passed in epoch 1515 is 0. 1516 - Fix bin->runcur management to fix a layout policy bug. This bug did not 1517 affect correctness. 1518 - Fix a bug in choose_arena_hard() that potentially caused more arenas to be 1519 initialized than necessary. 1520 - Add missing "opt.lg_tcache_max" mallctl implementation. 1521 - Use glibc allocator hooks to make mixed allocator usage less likely. 1522 - Fix build issues for --disable-tcache. 1523 - Don't mangle pthread_create() when --with-private-namespace is specified. 1524 1525 * 2.2.5 (November 14, 2011) 1526 1527 Bug fixes: 1528 - Fix huge_ralloc() race when using mremap(2). This is a serious bug that 1529 could cause memory corruption and/or crashes. 1530 - Fix huge_ralloc() to maintain chunk statistics. 1531 - Fix malloc_stats_print(..., "a") output. 1532 1533 * 2.2.4 (November 5, 2011) 1534 1535 Bug fixes: 1536 - Initialize arenas_tsd before using it. This bug existed for 2.2.[0-3], as 1537 well as for --disable-tls builds in earlier releases. 1538 - Do not assume a 4 KiB page size in test/rallocm.c. 1539 1540 * 2.2.3 (August 31, 2011) 1541 1542 This version fixes numerous bugs related to heap profiling. 1543 1544 Bug fixes: 1545 - Fix a prof-related race condition. This bug could cause memory corruption, 1546 but only occurred in non-default configurations (prof_accum:false). 1547 - Fix off-by-one backtracing issues (make sure that prof_alloc_prep() is 1548 excluded from backtraces). 1549 - Fix a prof-related bug in realloc() (only triggered by OOM errors). 1550 - Fix prof-related bugs in allocm() and rallocm(). 1551 - Fix prof_tdata_cleanup() for --disable-tls builds. 1552 - Fix a relative include path, to fix objdir builds. 1553 1554 * 2.2.2 (July 30, 2011) 1555 1556 Bug fixes: 1557 - Fix a build error for --disable-tcache. 1558 - Fix assertions in arena_purge() (for real this time). 1559 - Add the --with-private-namespace option. This is a workaround for symbol 1560 conflicts that can inadvertently arise when using static libraries. 1561 1562 * 2.2.1 (March 30, 2011) 1563 1564 Bug fixes: 1565 - Implement atomic operations for x86/x64. This fixes compilation failures 1566 for versions of gcc that are still in wide use. 1567 - Fix an assertion in arena_purge(). 1568 1569 * 2.2.0 (March 22, 2011) 1570 1571 This version incorporates several improvements to algorithms and data 1572 structures that tend to reduce fragmentation and increase speed. 1573 1574 New features: 1575 - Add the "stats.cactive" mallctl. 1576 - Update pprof (from google-perftools 1.7). 1577 - Improve backtracing-related configuration logic, and add the 1578 --disable-prof-libgcc option. 1579 1580 Bug fixes: 1581 - Change default symbol visibility from "internal", to "hidden", which 1582 decreases the overhead of library-internal function calls. 1583 - Fix symbol visibility so that it is also set on OS X. 1584 - Fix a build dependency regression caused by the introduction of the .pic.o 1585 suffix for PIC object files. 1586 - Add missing checks for mutex initialization failures. 1587 - Don't use libgcc-based backtracing except on x64, where it is known to work. 1588 - Fix deadlocks on OS X that were due to memory allocation in 1589 pthread_mutex_lock(). 1590 - Heap profiling-specific fixes: 1591 + Fix memory corruption due to integer overflow in small region index 1592 computation, when using a small enough sample interval that profiling 1593 context pointers are stored in small run headers. 1594 + Fix a bootstrap ordering bug that only occurred with TLS disabled. 1595 + Fix a rallocm() rsize bug. 1596 + Fix error detection bugs for aligned memory allocation. 1597 1598 * 2.1.3 (March 14, 2011) 1599 1600 Bug fixes: 1601 - Fix a cpp logic regression (due to the "thread.{de,}allocatedp" mallctl fix 1602 for OS X in 2.1.2). 1603 - Fix a "thread.arena" mallctl bug. 1604 - Fix a thread cache stats merging bug. 1605 1606 * 2.1.2 (March 2, 2011) 1607 1608 Bug fixes: 1609 - Fix "thread.{de,}allocatedp" mallctl for OS X. 1610 - Add missing jemalloc.a to build system. 1611 1612 * 2.1.1 (January 31, 2011) 1613 1614 Bug fixes: 1615 - Fix aligned huge reallocation (affected allocm()). 1616 - Fix the ALLOCM_LG_ALIGN macro definition. 1617 - Fix a heap dumping deadlock. 1618 - Fix a "thread.arena" mallctl bug. 1619 1620 * 2.1.0 (December 3, 2010) 1621 1622 This version incorporates some optimizations that can't quite be considered 1623 bug fixes. 1624 1625 New features: 1626 - Use Linux's mremap(2) for huge object reallocation when possible. 1627 - Avoid locking in mallctl*() when possible. 1628 - Add the "thread.[de]allocatedp" mallctl's. 1629 - Convert the manual page source from roff to DocBook, and generate both roff 1630 and HTML manuals. 1631 1632 Bug fixes: 1633 - Fix a crash due to incorrect bootstrap ordering. This only impacted 1634 --enable-debug --enable-dss configurations. 1635 - Fix a minor statistics bug for mallctl("swap.avail", ...). 1636 1637 * 2.0.1 (October 29, 2010) 1638 1639 Bug fixes: 1640 - Fix a race condition in heap profiling that could cause undefined behavior 1641 if "opt.prof_accum" were disabled. 1642 - Add missing mutex unlocks for some OOM error paths in the heap profiling 1643 code. 1644 - Fix a compilation error for non-C99 builds. 1645 1646 * 2.0.0 (October 24, 2010) 1647 1648 This version focuses on the experimental *allocm() API, and on improved 1649 run-time configuration/introspection. Nonetheless, numerous performance 1650 improvements are also included. 1651 1652 New features: 1653 - Implement the experimental {,r,s,d}allocm() API, which provides a superset 1654 of the functionality available via malloc(), calloc(), posix_memalign(), 1655 realloc(), malloc_usable_size(), and free(). These functions can be used to 1656 allocate/reallocate aligned zeroed memory, ask for optional extra memory 1657 during reallocation, prevent object movement during reallocation, etc. 1658 - Replace JEMALLOC_OPTIONS/JEMALLOC_PROF_PREFIX with MALLOC_CONF, which is 1659 more human-readable, and more flexible. For example: 1660 JEMALLOC_OPTIONS=AJP 1661 is now: 1662 MALLOC_CONF=abort:true,fill:true,stats_print:true 1663 - Port to Apple OS X. Sponsored by Mozilla. 1664 - Make it possible for the application to control thread-->arena mappings via 1665 the "thread.arena" mallctl. 1666 - Add compile-time support for all TLS-related functionality via pthreads TSD. 1667 This is mainly of interest for OS X, which does not support TLS, but has a 1668 TSD implementation with similar performance. 1669 - Override memalign() and valloc() if they are provided by the system. 1670 - Add the "arenas.purge" mallctl, which can be used to synchronously purge all 1671 dirty unused pages. 1672 - Make cumulative heap profiling data optional, so that it is possible to 1673 limit the amount of memory consumed by heap profiling data structures. 1674 - Add per thread allocation counters that can be accessed via the 1675 "thread.allocated" and "thread.deallocated" mallctls. 1676 1677 Incompatible changes: 1678 - Remove JEMALLOC_OPTIONS and malloc_options (see MALLOC_CONF above). 1679 - Increase default backtrace depth from 4 to 128 for heap profiling. 1680 - Disable interval-based profile dumps by default. 1681 1682 Bug fixes: 1683 - Remove bad assertions in fork handler functions. These assertions could 1684 cause aborts for some combinations of configure settings. 1685 - Fix strerror_r() usage to deal with non-standard semantics in GNU libc. 1686 - Fix leak context reporting. This bug tended to cause the number of contexts 1687 to be underreported (though the reported number of objects and bytes were 1688 correct). 1689 - Fix a realloc() bug for large in-place growing reallocation. This bug could 1690 cause memory corruption, but it was hard to trigger. 1691 - Fix an allocation bug for small allocations that could be triggered if 1692 multiple threads raced to create a new run of backing pages. 1693 - Enhance the heap profiler to trigger samples based on usable size, rather 1694 than request size. 1695 - Fix a heap profiling bug due to sometimes losing track of requested object 1696 size for sampled objects. 1697 1698 * 1.0.3 (August 12, 2010) 1699 1700 Bug fixes: 1701 - Fix the libunwind-based implementation of stack backtracing (used for heap 1702 profiling). This bug could cause zero-length backtraces to be reported. 1703 - Add a missing mutex unlock in library initialization code. If multiple 1704 threads raced to initialize malloc, some of them could end up permanently 1705 blocked. 1706 1707 * 1.0.2 (May 11, 2010) 1708 1709 Bug fixes: 1710 - Fix junk filling of large objects, which could cause memory corruption. 1711 - Add MAP_NORESERVE support for chunk mapping, because otherwise virtual 1712 memory limits could cause swap file configuration to fail. Contributed by 1713 Jordan DeLong. 1714 1715 * 1.0.1 (April 14, 2010) 1716 1717 Bug fixes: 1718 - Fix compilation when --enable-fill is specified. 1719 - Fix threads-related profiling bugs that affected accuracy and caused memory 1720 to be leaked during thread exit. 1721 - Fix dirty page purging race conditions that could cause crashes. 1722 - Fix crash in tcache flushing code during thread destruction. 1723 1724 * 1.0.0 (April 11, 2010) 1725 1726 This release focuses on speed and run-time introspection. Numerous 1727 algorithmic improvements make this release substantially faster than its 1728 predecessors. 1729 1730 New features: 1731 - Implement autoconf-based configuration system. 1732 - Add mallctl*(), for the purposes of introspection and run-time 1733 configuration. 1734 - Make it possible for the application to manually flush a thread's cache, via 1735 the "tcache.flush" mallctl. 1736 - Base maximum dirty page count on proportion of active memory. 1737 - Compute various additional run-time statistics, including per size class 1738 statistics for large objects. 1739 - Expose malloc_stats_print(), which can be called repeatedly by the 1740 application. 1741 - Simplify the malloc_message() signature to only take one string argument, 1742 and incorporate an opaque data pointer argument for use by the application 1743 in combination with malloc_stats_print(). 1744 - Add support for allocation backed by one or more swap files, and allow the 1745 application to disable over-commit if swap files are in use. 1746 - Implement allocation profiling and leak checking. 1747 1748 Removed features: 1749 - Remove the dynamic arena rebalancing code, since thread-specific caching 1750 reduces its utility. 1751 1752 Bug fixes: 1753 - Modify chunk allocation to work when address space layout randomization 1754 (ASLR) is in use. 1755 - Fix thread cleanup bugs related to TLS destruction. 1756 - Handle 0-size allocation requests in posix_memalign(). 1757 - Fix a chunk leak. The leaked chunks were never touched, so this impacted 1758 virtual memory usage, but not physical memory usage. 1759 1760 * linux_2008082[78]a (August 27/28, 2008) 1761 1762 These snapshot releases are the simple result of incorporating Linux-specific 1763 support into the FreeBSD malloc sources. 1764 1765 -------------------------------------------------------------------------------- 1766 vim:filetype=text:textwidth=80 1767