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