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