Up to [cvs.NetBSD.org] / pkgsrc / devel / jemalloc
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
jemalloc: updated to 5.4.0
5.4.0 (Sep 17, 2026)
This release contains over 160 commits, focusing on the technical debts
cleaning including refactorings, bug fixes, test coverage improvement, and
option cleanups. The release also includes portability improvements per
upstream issues report.
New features:
- Add `EXTENT_ALLOC_FLAG_PINNED` so custom extent-allocation hooks can
mark non-reclaimable mappings, such as HugeTLB pages, for preferential
reuse outside the decay and purge pipeline. Add the mallctl interfaces
`stats.pinned`, `stats.arenas.<i>.pinned`,
`stats.arenas.<i>.extents.<j>.npinned`,
`stats.arenas.<i>.extents.<j>.pinned_bytes`, and
`stats.arenas.<i>.mutexes.extents_pinned.{counter}` to report
pinned-memory usage and mutex statistics. (@binliu19: be2de8cc)
- Allow resuming per-CPU arena selection via `thread.arena`.
(@algunenano: 68c35f65)
- Better align the contents of human-readable and JSON malloc statistics.
(@spredolac: 68fe1be1, 30b1a410, 04aad97f)
- Replace the runtime `experimental_infallible_new` option with the
compile-time `--enable-cxx-infallible-new` option, enabling
compiler-level optimizations and optimization in move constructors,
and fix the `new(std::nothrow)` contract (@spredolac: 160ab9d7, fe336672)
Incompatible changes:
- Adapt tcache fill and retention targets per bin to demand observed
between GC events, replacing the fixed refill/flush policy. Remove
seven legacy non-experimental controls: `lg_tcache_nslots_mul`,
`tcache_nslots_small_min`, `tcache_nslots_small_max`,
`tcache_nslots_large`, `tcache_gc_delay_bytes`,
`lg_tcache_flush_small_div`, and `lg_tcache_flush_large_div`.
Corresponding `malloc_conf` settings are silently ignored, matching
`opt.*` mallctls return ENOENT, and `tcache_ncached_max` remains
supported. (@spredolac: d13fe91a)
Bug fixes:
- Preserve `errno` across `free`, `free_sized`, and `free_aligned_sized`,
and across `process_madvise`-based page purging. (@spredolac: 3a779661,
86f05828)
- Fix numeric overflow checks in size classes. (@spredolac: 6b245225)
- Accept NULL in `free_sized()` and `free_aligned_sized()` (C23
correctness). (@bigbruno: 7ce8b916)
- Fix TSD lifecycle edge cases by 1) initializing thread-cache bins before
marking the cache enabled, preventing reentrant bootstrap allocations
from using uninitialized state, and 2) avoiding TSD recreation for late
deallocations after thread teardown on generic-TSD platforms.
(@fzakaria: 54f22c83, @spredolac: fb5499aa)
- Use `O_CLOEXEC` when opening the THP sysfs file in `init_thp_state`.
(@ibookstein: d0705543)
- Fix duplicate `opt.stats_print` and `opt.stats_print_opts` fields in
`malloc_stats_print` output. (@spredolac: dfe3a2ed)
- Fix a potential deadlock during `arena_reset`. (@guangli-dai: 6957341f)
- Fix a prof-sampling / guard-page interaction bug in the SAN. (@gctony:
e36a0fa5)
Optimizations and refactors:
- Modularize jemalloc's front end by extracting arena management,
initialization, fork orchestration, and allocation dispatch from
`jemalloc.c`; untangle tcache/arena ownership; and consolidate the
internal header graph to eliminate circular dependencies. (@spredolac:
ba1e2fe4, 88745978, 9d757223, de9ad145, ...)
- Simplify ctl dispatch by refactoring arena helpers, internalizing an
implementation-only control, replacing control-flow macros with typed
helpers, and organizing `ctl.c` by subsystem. (@spredolac: 9e143468,
901365d4, 4e903a0a, 5bc8d6e9)
- Cap the base-block growth heuristic to avoid virtual-memory exhaustion
under rare racy conditions. (@guangli-dai: 2f4db8cf)
- Move background-thread lifecycle and state operations into the
background-thread module, clarifying ownership independently of PAC/HPA
callers. (@guangli-dai: f1f07923)
- Simplify the page-allocation boundary by replacing PAI vtable dispatch
with direct PAC/HPA calls, removing the obsolete `pai_t`/`pai.h`
abstraction, and moving deferred-work and decay orchestration out of the
arena. (@guangli-dai: 1dfa6f7a, 8edd1012, d410f43e)
- Refactor statistics collection and rendering into separate
gather/emission stages and descriptor-driven tables. (@spredolac:
184f304d, 80c8fcb4)
- Introduce an OS abstraction layer and move platform-dependent
file/process I/O, time, synchronization, CPU, virtual-memory, atfork,
error-handling, profiling, thread-yield, and configuration-access
operations out of allocator core code. (@guangli-dai: c4158aca,
c8e2e013, ...)
Portability improvements:
- Replace the `std::__throw_bad_alloc` call with standard C++
(@lexprfuncall: 1a15fe33)
- Make `arena_s` use a flexible array member (`bin_t all_bins[]`) for C99
or newer. (@grueninger: 300b58b4)
- Fix rdtscp detection with `--with-lg-vaddr`. (@xinydev: e8a0d2b4)
- Fix `malloc_getcpu` on macOS to read the current CPU number correctly.
(@algunenano: 5aabbc87)
- Use `CLOCK_MONOTONIC` for background-thread sleep to prevent
clock-rollback stalls, and detect monotonic-condvar support at configure
time. (@antonio2368: ebacec3a, 8361239b)
- Fix compilation warnings on macOS. (@gctony: abb0a8a0)
- Fix thread-exit TSD cleanup on MinGW builds. (@gctony: 1e923170)
- Fix GCC 16 build warnings by removing `-Wpedantic` violations in macro
and function syntax and explicitly NUL-terminating profiling thread-name
copies to resolve `-Wstringop-truncation`. (@grueninger: 5acdcee6,
c22d929a, @jasonangelov: 6a245e02)
- Parse PID-namespace symlinks without glibc-dependent `strtok`/`atol`,
and return identifiers as `uint64_t`. (@guangli-dai: 278d90a5)
jemalloc: updated to 5.3.1 5.3.1 (Apr 13, 2026) This release includes over 390 commits spanning bug fixes, new features, performance optimizations, and portability improvements. Multiple percent of system-level metric improvements were measured in tested production workloads. The release has gone through large-scale production testing at Meta.
Fix previously added option "doc"
Add option "doc" for disabling heavy dependency on docbook-xsl and libxslt. Approved by gson@
Mass-change BUILD_DEPENDS to TOOL_DEPENDS outside mk/. Almost all uses, if not all of them, are wrong, according to the semantics of BUILD_DEPENDS (packages built for target available for use _by_ tools at build-time) and TOOL_DEPEPNDS (packages built for host available for use _as_ tools at build-time). No change to BUILD_DEPENDS as used correctly inside buildlink3. As proposed on tech-pkg: https://mail-index.netbsd.org/tech-pkg/2023/06/03/msg027632.html
Fix for over-alignment bug from Andreas Gustafsson
jemalloc: update to 5.3.0.
* 5.3.0 (May 6, 2022)
This release contains many speed and space optimizations, from micro
optimizations on common paths to rework of internal data structures and
locking schemes, and many more too detailed to list below. Multiple percent
of system level metric improvements were measured in tested production
workloads. The release has gone through large-scale production testing.
New features:
- Add the thread.idle mallctl which hints that the calling thread will be
idle for a nontrivial period of time. (@davidtgoldblatt)
- Allow small size classes to be the maximum size class to cache in the
thread-specific cache, through the opt.[lg_]tcache_max option. (@interwq,
@jordalgo)
- Make the behavior of realloc(ptr, 0) configurable with opt.zero_realloc.
(@davidtgoldblatt)
- Add 'make uninstall' support. (@sangshuduo, @Lapenkov)
- Support C++17 over-aligned allocation. (@marksantaniello)
- Add the thread.peak mallctl for approximate per-thread peak memory tracking.
(@davidtgoldblatt)
- Add interval-based stats output opt.stats_interval. (@interwq)
- Add prof.prefix to override filename prefixes for dumps. (@zhxchen17)
- Add high resolution timestamp support for profiling. (@tyroguru)
- Add the --collapsed flag to jeprof for flamegraph generation.
(@igorwwwwwwwwwwwwwwwwwwww)
- Add the --debug-syms-by-id option to jeprof for debug symbols discovery.
(@DeannaGelbart)
- Add the opt.prof_leak_error option to exit with error code when leak is
detected using opt.prof_final. (@yunxuo)
- Add opt.cache_oblivious as an runtime alternative to config.cache_oblivious.
(@interwq)
- Add mallctl interfaces:
+ opt.zero_realloc (@davidtgoldblatt)
+ opt.cache_oblivious (@interwq)
+ opt.prof_leak_error (@yunxuo)
+ opt.stats_interval (@interwq)
+ opt.stats_interval_opts (@interwq)
+ opt.tcache_max (@interwq)
+ opt.trust_madvise (@azat)
+ prof.prefix (@zhxchen17)
+ stats.zero_reallocs (@davidtgoldblatt)
+ thread.idle (@davidtgoldblatt)
+ thread.peak.{read,reset} (@davidtgoldblatt)
Bug fixes:
- Fix the synchronization around explicit tcache creation which could cause
invalid tcache identifiers. This regression was first released in 5.0.0.
(@yoshinorim, @davidtgoldblatt)
- Fix a profiling biasing issue which could cause incorrect heap usage and
object counts. This issue existed in all previous releases with the heap
profiling feature. (@davidtgoldblatt)
- Fix the order of stats counter updating on large realloc which could cause
failed assertions. This regression was first released in 5.0.0. (@azat)
- Fix the locking on the arena destroy mallctl, which could cause concurrent
arena creations to fail. This functionality was first introduced in 5.0.0.
(@interwq)
Portability improvements:
- Remove nothrow from system function declarations on macOS and FreeBSD.
(@davidtgoldblatt, @fredemmott, @leres)
- Improve overcommit and page alignment settings on NetBSD. (@zoulasc)
- Improve CPU affinity support on BSD platforms. (@devnexen)
- Improve utrace detection and support. (@devnexen)
- Improve QEMU support with MADV_DONTNEED zeroed pages detection. (@azat)
- Add memcntl support on Solaris / illumos. (@devnexen)
- Improve CPU_SPINWAIT on ARM. (@AWSjswinney)
- Improve TSD cleanup on FreeBSD. (@Lapenkov)
- Disable percpu_arena if the CPU count cannot be reliably detected. (@azat)
- Add malloc_size(3) override support. (@devnexen)
- Add mmap VM_MAKE_TAG support. (@devnexen)
- Add support for MADV_[NO]CORE. (@devnexen)
- Add support for DragonFlyBSD. (@devnexen)
- Fix the QUANTUM setting on MIPS64. (@brooksdavis)
- Add the QUANTUM setting for ARC. (@vineetgarc)
- Add the QUANTUM setting for LoongArch. (@wangjl-uos)
- Add QNX support. (@jqian-aurora)
- Avoid atexit(3) calls unless the relevant profiling features are enabled.
(@BusyJay, @laiwei-rice, @interwq)
- Fix unknown option detection when using Clang. (@Lapenkov)
- Fix symbol conflict with musl libc. (@georgthegreat)
- Add -Wimplicit-fallthrough checks. (@nickdesaulniers)
- Add __forceinline support on MSVC. (@santagada)
- Improve FreeBSD and Windows CI support. (@Lapenkov)
- Add CI support for PPC64LE architecture. (@ezeeyahoo)
Incompatible changes:
- Maximum size class allowed in tcache (opt.[lg_]tcache_max) now has an upper
bound of 8MiB. (@interwq)
Optimizations and refactors (@davidtgoldblatt, @Lapenkov, @interwq):
- Optimize the common cases of the thread cache operations.
- Optimize internal data structures, including RB tree and pairing heap.
- Optimize the internal locking on extent management.
- Extract and refactor the internal page allocator and interface modules.
Documentation:
- Fix doc build with --with-install-suffix. (@lawmurray, @interwq)
- Add PROFILING_INTERNALS.md. (@davidtgoldblatt)
- Ensure the proper order of doc building and installation. (@Mingli-Yu)
*: recursive bump for perl 5.36
devel/jemalloc: set SHELL explicitly so it gets something useful on Solaris
*: recursive bump for perl 5.34
*: bump PKGREVISION for perl-5.32.
devel/jemalloc: remove unknown configure option The configure program does not contain the word "silent" anymore.
Bump PKGREVISIONs for perl 5.30.0
jemalloc: updated to 5.2.1 5.2.1 This release is primarily about Windows. A critical virtual memory leak is resolved on all Windows platforms. The regression was present in all releases since 5.0.0. Bug fixes: Fix a severe virtual memory leak on Windows. This regression was first released in 5.0.0. Fix size 0 handling in posix_memalign(). This regression was first released in 5.2.0. Fix the prof_log unit test which may observe unexpected backtraces from compiler optimizations. The test was first added in 5.2.0. Fix the declaration of the extent_avail tree. This regression was first released in 5.1.0. Fix an incorrect reference in jeprof. This functionality was first released in 3.0.0. Fix an assertion on the deallocation fast-path. This regression was first released in 5.2.0. Fix the TLS_MODEL attribute in headers. This regression was first released in 5.0.0. Optimizations and refactors: Implement opt.retain on Windows and enable by default on 64-bit. Optimize away a branch on the operator delete path. Add format annotation to the format generator function. Refactor and improve the size class header generation. Remove best fit. Avoid blocking on background thread locks for stats.
jemalloc: updated to 5.2.0
5.2.0:
This release includes a few notable improvements, which are summarized below: 1) improved fast-path performance from the optimizations by @djwatson; 2) reduced virtual memory fragmentation and metadata usage; and 3) bug fixes on setting the number of background threads. In addition, peak / spike memory usage is improved with certain allocation patterns. As usual, the release and prior dev versions have gone through large-scale production testing.
New features:
Implement oversize_threshold, which uses a dedicated arena for allocations crossing the specified threshold to reduce fragmentation.
Add extents usage information to stats.
Log time information for sampled allocations.
Support 0 size in sdallocx.
Output rate for certain counters in malloc_stats.
Add configure option --enable-readlinkat, which allows the use of readlinkat over readlink.
Add configure options --{enable,disable}-{static,shared} to allow not building unwanted libraries.
Add configure option --disable-libdl to enable fully static builds.
Add mallctl interfaces:
opt.oversize_threshold
stats.arenas.<i>.extent_avail
stats.arenas.<i>.extents.<j>.n{dirty,muzzy,retained}
stats.arenas.<i>.extents.<j>.{dirty,muzzy,retained}_bytes
Portability improvements:
Update MSVC builds.
Workaround a compiler optimizer bug on s390x.
Make use of pthread_set_name_np(3) on FreeBSD.
Implement malloc_getcpu() to enable percpu_arena for windows.
Link against -pthread instead of -lpthread.
Make background_thread not dependent on libdl.
Add stringify to fix a linker directive issue on MSVC.
Detect and fall back when 8-bit atomics are unavailable.
Fall back to the default pthread_create(3) if dlsym(3) fails.
Optimizations and refactors:
Refactor the TSD module.
Avoid taking extents_muzzy mutex when muzzy is disabled.
Avoid taking large_mtx for auto arenas on the tcache flush path.
Optimize ixalloc by avoiding a size lookup.
Implement opt.oversize_threshold which uses a dedicated arena for requests crossing the threshold, also eagerly purges the oversize extents. Default the threshold to 8 MiB.
Clean compilation with -Wextra.
Refactor the size class module.
Refactor the stats emitter.
Optimize pow2_ceil.
Avoid runtime detection of lazy purging on FreeBSD.
Optimize mmap(2) alignment handling on FreeBSD.
Improve error handling for THP state initialization.
Rework the malloc() fast path.
Rework the free() fast path.
Refactor and optimize the tcache fill / flush paths.
Optimize sync / lwsync on PowerPC.
Bypass extent_dalloc() when retain is enabled.
Optimize the locking on large deallocation.
Reduce the number of pages committed from sanity checking in debug build.
Deprecate OSSpinLock.
Lower the default number of background threads to 4 (when the feature is enabled).
Optimize the trylock spin wait.
Use arena index for arena-matching checks.
Avoid forced decay on thread termination when using background threads.
Disable muzzy decay by default.
Only initialize libgcc unwinder when profiling is enabled.
Bug fixes (all only relevant to jemalloc 5.x):
Fix background thread index issues with max_background_threads.
Fix stats output for opt.lg_extent_max_active_fit.
Fix opt.prof_prefix initialization.
Properly trigger decay on tcache destroy.
Fix tcache.flush.
Detect whether explicit extent zero out is necessary with huge pages or custom extent hooks, which may change the purge semantics.
Fix a side effect caused by extent_max_active_fit combined with decay-based purging, where freed extents can accumulate and not be reused for an extended period of time.
Fix a missing unlock on extent register error handling.
Testing:
Simplify the Travis script output.
Update the test scripts for FreeBSD.
Add unit tests for the producer-consumer pattern.
Add Cirrus-CI config for FreeBSD builds.
Add size-matching sanity checks on tcache flush.
Incompatible changes:
Remove --with-lg-page-sizes.
Documentation:
Attempt to build docs by default, however skip doc building when xsltproc is missing.
Bump revision in order to make it easier to compare with local jemalloc of NetBSD: - restrict "os_overcommits" workaround to NetBSD < 8.0 - add debug option
Recursive bump for perl5-5.28.0
jemalloc: updated to 5.1.0 5.1.0: This release is primarily about fine-tuning, ranging from several new features to numerous notable performance and portability enhancements. The release and prior dev versions have been running in multiple large scale applications for months, and the cumulative improvements are substantial in many cases.
5.0.1: This bugfix release fixes several issues, most of which are obscure enough that typical applications are not impacted. Bug fixes: Update decay->nunpurged before purging, in order to avoid potential update races and subsequent incorrect purging volume. Only abort on dlsym(3) error if the failure impacts an enabled feature (lazy locking and/or background threads). This mitigates an initialization failure bug for which we still do not have a clear reproduction test case. Modify tsd management so that it neither crashes nor leaks if a thread's only allocation activity is to call free() after TLS destructors have been executed. This behavior was observed when operating with GNU libc, and is unlikely to be an issue with other libc implementations. Mask signals during background thread creation. This prevents signals from being inadvertently delivered to background threads. Avoid inactivity checks within background threads, in order to prevent recursive mutex acquisition. Fix extent_grow_retained() to use the specified hooks when the arena.<i>.extent_hooks mallctl is used to override the default hooks. Add missing reentrancy support for custom extent hooks which allocate. Post-fork(2), re-initialize the list of tcaches associated with each arena to contain no tcaches except the forking thread's. Add missing post-fork(2) mutex reinitialization for extent_grow_mtx. This fixes potential deadlocks after fork(2). Enforce minimum autoconf version (currently 2.68), since 2.63 is known to generate corrupt configure scripts. Ensure that the configured page size (--with-lg-page) is no larger than the configured huge page size (--with-lg-hugepage).
Set os_overcommits to true on NetBSD since NetBSD does overcommit. This also has the benefit of not triggering the issue reported in https://github.com/jemalloc/jemalloc/issues/837 .
Add TEST_TARGET and TEST_ENV. Tests are currently failing on NetBSD; reported upstream in https://github.com/jemalloc/jemalloc/issues/837
Update devel/jemalloc to 4.5.0. Changes since 4.4.0:
* 4.5.0 (February 28, 2017)
This is the first release to benefit from much broader continuous integration
testing, thanks to @davidtgoldblatt. Had we had this testing infrastructure
in place for prior releases, it would have caught all of the most serious
regressions fixed by this release.
New features:
- Add --disable-thp and the opt.thp to provide opt-out mechanisms for
transparent huge page integration. (@jasone)
- Update zone allocator integration to work with macOS 10.12. (@glandium)
- Restructure *CFLAGS configuration, so that CFLAGS behaves typically, and
EXTRA_CFLAGS provides a way to specify e.g. -Werror during building, but not
during configuration. (@jasone, @ronawho)
Bug fixes:
- Fix DSS (sbrk(2)-based) allocation. This regression was first released in
4.3.0. (@jasone)
- Handle race in per size class utilization computation. This functionality
was first released in 4.0.0. (@interwq)
- Fix lock order reversal during gdump. (@jasone)
- Fix-refactor tcache synchronization. This regression was first released in
4.0.0. (@jasone)
- Fix various JSON-formatted malloc_stats_print() bugs. This functionality
was first released in 4.3.0. (@jasone)
- Fix huge-aligned allocation. This regression was first released in 4.4.0.
(@jasone)
- When transparent huge page integration is enabled, detect what state pages
start in according to the kernel's current operating mode, and only convert
arena chunks to non-huge during purging if that is not their initial state.
This functionality was first released in 4.4.0. (@jasone)
- Fix lg_chunk clamping for the --enable-cache-oblivious --disable-fill case.
This regression was first released in 4.0.0. (@jasone, @428desmo)
- Properly detect sparc64 when building for Linux. (@glaubitz)
jemalloc: update to 4.4.0
New features:
Add configure support for *-*-linux-android. (@cferris1000, @jasone)
Add the --disable-syscall configure option, for use on systems that place security-motivated limitations on syscall(2). (@jasone)
Add support for Debian GNU/kFreeBSD. (@thesam)
Optimizations:
Add extent serial numbers and use them where appropriate as a sort key that is higher priority than address, so that the allocation policy prefers older extents. This tends to improve locality (decrease fragmentation) when memory grows downward. (@jasone)
Refactor madvise(2) configuration so that MADV_FREE is detected and utilized on Linux 4.5 and newer. (@jasone)
Mark partially purged arena chunks as non-huge-page. This improves interaction with Linux's transparent huge page functionality. (@jasone)
Bug fixes:
Fix size class computations for edge conditions involving extremely large allocations. This regression was first released in 4.0.0. (@jasone, @ingvarha)
Remove overly restrictive assertions related to the cactive statistic. This regression was first released in 4.1.0. (@jasone)
Implement a more reliable detection scheme for os_unfair_lock on macOS. (@jszakmeister)
From Jonathan Buschmann in PR pkg/51631
jemalloc: update to 4.3.1
from Jonathan Buschmann in PR pkg/51631
ok gson
Changelog :
4.3.1
Bug fixes:
Fix a severe virtual memory leak. This regression was first released in 4.3.0. (@interwq, @jasone)
Refactor atomic and prng APIs to restore support for 32-bit platforms that use pre-C11 toolchains, e.g. FreeBSD's mips. (@jasone)
4.3.0
This is the first release that passes the test suite for multiple Windows configurations, thanks in large part to @glandium setting up continuous integration via AppVeyor (and Travis CI for Linux and OS X).
New features:
Add "J" (JSON) support to malloc_stats_print(). (@jasone)
Add Cray compiler support. (@ronawho)
Optimizations:
Add/use adaptive spinning for bootstrapping and radix tree node initialization. (@jasone)
Bug fixes:
Fix large allocation to search starting in the optimal size class heap, which can substantially reduce virtual memory churn and fragmentation. This regression was first released in 4.0.0. (@mjp41, @jasone)
Fix stats.arenas..nthreads accounting. (@interwq)
Fix and simplify decay-based purging. (@jasone)
Make DSS (sbrk(2)-related) operations lockless, which resolves potential deadlocks during thread exit. (@jasone)
Fix over-sized allocation of radix tree leaf nodes. (@mjp41, @ogaun, @jasone)
Fix over-sized allocation of arena_t (plus associated stats) data structures. (@jasone, @interwq)
Fix EXTRA_CFLAGS to not affect configuration. (@jasone)
Fix a Valgrind integration bug. (@ronawho)
Disallow 0x5a junk filling when running in Valgrind. (@jasone)
Fix a file descriptor leak on Linux. This regression was first released in 4.2.0. (@vsarunas, @jasone)
Fix static linking of jemalloc with glibc. (@djwatson)
Use syscall(2) rather than {open,read,close}(2) during boot on Linux. This works around other libraries' system call wrappers performing reentrant allocation. (@kspinka, @Whissi, @jasone)
Fix OS X default zone replacement to work with OS X 10.12. (@glandium, @jasone)
Fix cached memory management to avoid needless commit/decommit operations during purging, which resolves permanent virtual memory map fragmentation issues on Windows. (@mjp41, @jasone)
Fix TSD fetches to avoid (recursive) allocation. This is relevant to non-TLS and Windows configurations. (@jasone)
Fix malloc_conf overriding to work on Windows. (@jasone)
Forcibly disable lazy-lock on Windows (was forcibly enabled). (@jasone)
Bump PKGREVISION for perl-5.24.0 for everything mentioning perl.
Add missing PKGCONFIG_OVERRIDE. Ride upgrade.
Updated jemalloc to 4.2.1.
Provided by Jonathan Buschmann in PR 51302.
* 4.2.1 (June 8, 2016)
Bug fixes:
- Fix bootstrapping issues for configurations that require allocation during
tsd initialization (e.g. --disable-tls). (@cferris1000, @jasone)
- Fix gettimeofday() version of nstime_update(). (@ronawho)
- Fix Valgrind regressions in calloc() and chunk_alloc_wrapper(). (@ronawho)
- Fix potential VM map fragmentation regression. (@jasone)
- Fix opt_zero-triggered in-place huge reallocation zeroing. (@jasone)
- Fix heap profiling context leaks in reallocation edge cases. (@jasone)
* 4.2.0 (May 12, 2016)
New features:
- Add the arena.<i>.reset mallctl, which makes it possible to discard all of
an arena's allocations in a single operation. (@jasone)
- Add the stats.retained and stats.arenas.<i>.retained statistics. (@jasone)
- Add the --with-version configure option. (@jasone)
- Support --with-lg-page values larger than actual page size. (@jasone)
Optimizations:
- Use pairing heaps rather than red-black trees for various hot data
structures. (@djwatson, @jasone)
- Streamline fast paths of rtree operations. (@jasone)
- Optimize the fast paths of calloc() and [m,d,sd]allocx(). (@jasone)
- Decommit unused virtual memory if the OS does not overcommit. (@jasone)
- Specify MAP_NORESERVE on Linux if [heuristic] overcommit is active, in order
to avoid unfortunate interactions during fork(2). (@jasone)
Bug fixes:
- Fix chunk accounting related to triggering gdump profiles. (@jasone)
- Link against librt for clock_gettime(2) if glibc < 2.17. (@jasone)
- Scale leak report summary according to sampling probability. (@jasone)
* 4.1.1 (May 3, 2016)
This bugfix release resolves a variety of mostly minor issues, though the
bitmap fix is critical for 64-bit Windows.
Bug fixes:
- Fix the linear scan version of bitmap_sfu() to shift by the proper amount
even when sizeof(long) is not the same as sizeof(void *), as on 64-bit
Windows. (@jasone)
- Fix hashing functions to avoid unaligned memory accesses (and resulting
crashes). This is relevant at least to some ARM-based platforms.
(@rkmisra)
- Fix fork()-related lock rank ordering reversals. These reversals were
unlikely to cause deadlocks in practice except when heap profiling was
enabled and active. (@jasone)
- Fix various chunk leaks in OOM code paths. (@jasone)
- Fix malloc_stats_print() to print opt.narenas correctly. (@jasone)
- Fix MSVC-specific build/test issues. (@rustyx, @yuslepukhin)
- Fix a variety of test failures that were due to test fragility rather than
core bugs. (@jasone)
* 4.1.0 (February 28, 2016)
This release is primarily about optimizations, but it also incorporates a lot
of portability-motivated refactoring and enhancements. Many people worked on
this release, to an extent that even with the omission here of minor changes
(see git revision history), and of the people who reported and diagnosed
issues, so much of the work was contributed that starting with this release,
changes are annotated with author credits to help reflect the collaborative
effort involved.
New features:
- Implement decay-based unused dirty page purging, a major optimization with
mallctl API impact. This is an alternative to the existing ratio-based
unused dirty page purging, and is intended to eventually become the sole
purging mechanism. New mallctls:
+ opt.purge
+ opt.decay_time
+ arena.<i>.decay
+ arena.<i>.decay_time
+ arenas.decay_time
+ stats.arenas.<i>.decay_time
(@jasone, @cevans87)
- Add --with-malloc-conf, which makes it possible to embed a default
options string during configuration. This was motivated by the desire to
specify --with-malloc-conf=purge:decay , since the default must remain
purge:ratio until the 5.0.0 release. (@jasone)
- Add MS Visual Studio 2015 support. (@rustyx, @yuslepukhin)
- Make *allocx() size class overflow behavior defined. The maximum
size class is now less than PTRDIFF_MAX to protect applications against
numerical overflow, and all allocation functions are guaranteed to indicate
errors rather than potentially crashing if the request size exceeds the
maximum size class. (@jasone)
- jeprof:
+ Add raw heap profile support. (@jasone)
+ Add --retain and --exclude for backtrace symbol filtering. (@jasone)
Optimizations:
- Optimize the fast path to combine various bootstrapping and configuration
checks and execute more streamlined code in the common case. (@interwq)
- Use linear scan for small bitmaps (used for small object tracking). In
addition to speeding up bitmap operations on 64-bit systems, this reduces
allocator metadata overhead by approximately 0.2%. (@djwatson)
- Separate arena_avail trees, which substantially speeds up run tree
operations. (@djwatson)
- Use memoization (boot-time-computed table) for run quantization. Separate
arena_avail trees reduced the importance of this optimization. (@jasone)
- Attempt mmap-based in-place huge reallocation. This can dramatically speed
up incremental huge reallocation. (@jasone)
Incompatible changes:
- Make opt.narenas unsigned rather than size_t. (@jasone)
Bug fixes:
- Fix stats.cactive accounting regression. (@rustyx, @jasone)
- Handle unaligned keys in hash(). This caused problems for some ARM systems.
(@jasone, @cferris1000)
- Refactor arenas array. In addition to fixing a fork-related deadlock, this
makes arena lookups faster and simpler. (@jasone)
- Move retained memory allocation out of the default chunk allocation
function, to a location that gets executed even if the application installs
a custom chunk allocation function. This resolves a virtual memory leak.
(@buchgr)
- Fix a potential tsd cleanup leak. (@cferris1000, @jasone)
- Fix run quantization. In practice this bug had no impact unless
applications requested memory with alignment exceeding one page.
(@jasone, @djwatson)
- Fix LinuxThreads-specific bootstrapping deadlock. (Cosmin Paraschiv)
- jeprof:
+ Don't discard curl options if timeout is not defined. (@djwatson)
+ Detect failed profile fetches. (@djwatson)
- Fix stats.arenas.<i>.{dss,lg_dirty_mult,decay_time,pactive,pdirty} for
--disable-stats case. (@jasone)
Import jemalloc-4.04, packaged for wip by Jonathan Buschmann <jonthn+pkgsrc@pinacea.com>. jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. jemalloc first came into use as the FreeBSD libc allocator in 2005. In 2010 jemalloc development efforts broadened to include developer support features such as heap profiling, Valgrind integration, and extensive monitoring/tuning hooks. Ongoing development efforts trend toward making jemalloc among the best allocators for a broad range of demanding applications, and eliminating/mitigating weaknesses that have practical repercussions for real world applications. This is a newer version of jemalloc than the one in NetBSD's libc.