Skip to content

Releases: jemalloc/jemalloc

3.5.1

18 Apr 16:31
Compare
Choose a tag to compare

This version primarily addresses minor bugs in test code.

Bug fixes:

  • Configure Solaris/Illumos to use MADV_FREE.
  • Fix junk filling for mremap(2)-based huge reallocation. This is only
    relevant if configuring with the --enable-mremap option specified.
  • Avoid compilation failure if 'restrict' C99 keyword is not supported by the
    compiler.
  • Add a configure test for SSE2 rather than assuming it is usable on i686
    systems. This fixes test compilation errors, especially on 32-bit Linux
    systems.
  • Fix mallctl argument size mismatches (size_t vs. uint64_t) in the stats unit
    test.
  • Fix/remove flawed alignment-related overflow tests.
  • Prevent compiler optimizations that could change backtraces in the
    prof_accum unit test.

3.5.0

18 Apr 16:32
Compare
Choose a tag to compare

This version focuses on refactoring and automated testing, though it also includes some non-trivial heap profiling optimizations not mentioned below.

New features:

  • Add the *allocx() API, which is a successor to the experimental *allocm()
    API. The *allocx() functions are slightly simpler to use because they have
    fewer parameters, they directly return the results of primary interest, and
    mallocx()/rallocx() avoid the strict aliasing pitfall that
    allocm()/rallocm() share with posix_memalign(). Note that *allocm() is
    slated for removal in the next non-bugfix release.
  • Add support for LinuxThreads.

Bug fixes:

  • Unless heap profiling is enabled, disable floating point code and don't link
    with libm. This, in combination with e.g. EXTRA_CFLAGS=-mno-sse on x64
    systems, makes it possible to completely disable floating point register
    use. Some versions of glibc neglect to save/restore caller-saved floating
    point registers during dynamic lazy symbol loading, and the symbol loading
    code uses whatever malloc the application happens to have linked/loaded
    with, the result being potential floating point register corruption.
  • Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling
    backtrace creation in imemalign(). This bug impacted posix_memalign() and
    aligned_alloc().
  • Fix a file descriptor leak in a prof_dump_maps() error path.
  • Fix prof_dump() to close the dump file descriptor for all relevant error
    paths.
  • Fix rallocm() to use the arena specified by the ALLOCM_ARENA(s) flag for
    allocation, not just deallocation.
  • Fix a data race for large allocation stats counters.
  • Fix a potential infinite loop during thread exit. This bug occurred on
    Solaris, and could affect other platforms with similar pthreads TSD
    implementations.
  • Don't junk-fill reallocations unless usable size changes. This fixes a
    violation of the _allocx()/_allocm() semantics.
  • Fix growing large reallocation to junk fill new space.
  • Fix huge deallocation to junk fill when munmap is disabled.
  • Change the default private namespace prefix from empty to je_, and change
    --with-private-namespace-prefix so that it prepends an additional prefix
    rather than replacing je_. This reduces the likelihood of applications
    which statically link jemalloc experiencing symbol name collisions.
  • Add missing private namespace mangling (relevant when
    --with-private-namespace is specified).
  • Add and use JEMALLOC_INLINE_C so that static inline functions are marked as
    static even for debug builds.
  • Add a missing mutex unlock in a malloc_init_hard() error path. In practice
    this error path is never executed.
  • Fix numerous bugs in malloc_strotumax() error handling/reporting. These
    bugs had no impact except for malformed inputs.
  • Fix numerous bugs in malloc_snprintf(). These bugs were not exercised by
    existing calls, so they had no impact.

3.4.1

18 Apr 16:34
Compare
Choose a tag to compare

Bug fixes:

  • Fix a race in the "arenas.extend" mallctl that could cause memory corruption
    of internal data structures and subsequent crashes.
  • Fix Valgrind integration flaws that caused Valgrind warnings about reads of
    uninitialized memory in:
    • arena chunk headers
    • internal zero-initialized data structures (relevant to tcache and prof
      code)
  • Preserve errno during the first allocation. A readlink(2) call during
    initialization fails unless /etc/malloc.conf exists, so errno was typically
    set during the first allocation prior to this fix.
  • Fix compilation warnings reported by gcc 4.8.1.

3.4.0

18 Apr 16:34
Compare
Choose a tag to compare

This version is essentially a small bugfix release, but the addition of aarch64 support requires that the minor version be incremented.

Bug fixes:

  • Fix race-triggered deadlocks in chunk_record(). These deadlocks were
    typically triggered by multiple threads concurrently deallocating huge
    objects.

New features:

  • Add support for the aarch64 architecture.

3.3.1

18 Apr 16:35
Compare
Choose a tag to compare

This version fixes bugs that are typically encountered only when utilizing custom run-time options.

Bug fixes:

  • Fix a locking order bug that could cause deadlock during fork if heap
    profiling were enabled.
  • Fix a chunk recycling bug that could cause the allocator to lose track of
    whether a chunk was zeroed. On FreeBSD, NetBSD, and OS X, it could cause
    corruption if allocating via sbrk(2) (unlikely unless running with the
    "dss:primary" option specified). This was completely harmless on Linux
    unless using mlockall(2) (and unlikely even then, unless the
    --disable-munmap configure option or the "dss:primary" option was
    specified). This regression was introduced in 3.1.0 by the
    mlockall(2)/madvise(2) interaction fix.
  • Fix TLS-related memory corruption that could occur during thread exit if the
    thread never allocated memory. Only the quarantine and prof facilities were
    susceptible.
  • Fix two quarantine bugs:
    • Internal reallocation of the quarantined object array leaked the old
      array.
    • Reallocation failure for internal reallocation of the quarantined object
      array (very unlikely) resulted in memory corruption.
  • Fix Valgrind integration to annotate all internally allocated memory in a
    way that keeps Valgrind happy about internal data structure access.
  • Fix building for s390 systems.

3.3.0

18 Apr 16:36
Compare
Choose a tag to compare

This version includes a few minor performance improvements in addition to the listed new features and bug fixes.

New features:

  • Add clipping support to lg_chunk option processing.
  • Add the --enable-ivsalloc option.
  • Add the --without-export option.
  • Add the --disable-zone-allocator option.

Bug fixes:

  • Fix "arenas.extend" mallctl to output the number of arenas.
  • Fix chunk_recycle() to unconditionally inform Valgrind that returned memory
    is undefined.
  • Fix build break on FreeBSD related to alloca.h.

3.2.0

18 Apr 16:38
Compare
Choose a tag to compare

In addition to a couple of bug fixes, this version modifies page run allocation and dirty page purging algorithms in order to better control page-level virtual memory fragmentation.

Incompatible changes:

  • Change the "opt.lg_dirty_mult" default from 5 to 3 (32:1 to 8:1).

Bug fixes:

  • Fix dss/mmap allocation precedence code to use recyclable mmap memory only
    after primary dss allocation fails.
  • Fix deadlock in the "arenas.purge" mallctl. This regression was introduced
    in 3.1.0 by the addition of the "arena.<i>.purge" mallctl.

3.1.0

18 Apr 16:40
Compare
Choose a tag to compare

New features:

  • Auto-detect whether running inside Valgrind, thus removing the need to
    manually specify MALLOC_CONF=valgrind:true.
  • Add the "arenas.extend" mallctl, which allows applications to create
    manually managed arenas.
  • Add the ALLOCM_ARENA() flag for {,r,d}allocm().
  • Add the "opt.dss", "arena.<i>.dss", and "stats.arenas.<i>.dss" mallctls,
    which provide control over dss/mmap precedence.
  • Add the "arena.<i>.purge" mallctl, which obsoletes "arenas.purge".
  • Define LG_QUANTUM for hppa.

Incompatible changes:

  • Disable tcache by default if running inside Valgrind, in order to avoid
    making unallocated objects appear reachable to Valgrind.
  • Drop const from malloc_usable_size() argument on Linux.

Bug fixes:

  • Fix heap profiling crash if sampled object is freed via realloc(p, 0).
  • Remove const from __*_hook variable declarations, so that glibc can modify
    them during process forking.
  • Fix mlockall(2)/madvise(2) interaction.
  • Fix fork(2)-related deadlocks.
  • Fix error return value for "thread.tcache.enabled" mallctl.

3.0.0

18 Apr 16:44
Compare
Choose a tag to compare

Although this version adds some major new features, the primary focus is on internal code cleanup that facilitates maintainability and portability, most of which is not reflected in the ChangeLog. This is the first release to incorporate substantial contributions from numerous other developers, and the result is a more broadly useful allocator (see the git revision history for contribution details). Note that the license has been unified, thanks to Facebook granting a license under the same terms as the other copyright holders (see COPYING).

New features:

  • Implement Valgrind support, redzones, and quarantine.
  • Add support for additional platforms:
    • FreeBSD
    • Mac OS X Lion
    • MinGW
    • Windows (no support yet for replacing the system malloc)
  • Add support for additional architectures:
    • MIPS
    • SH4
    • Tilera
  • Add support for cross compiling.
  • Add nallocm(), which rounds a request size up to the nearest size class
    without actually allocating.
  • Implement aligned_alloc() (blame C11).
  • Add the "thread.tcache.enabled" mallctl.
  • Add the "opt.prof_final" mallctl.
  • Update pprof (from gperftools 2.0).
  • Add the --with-mangling option.
  • Add the --disable-experimental option.
  • Add the --disable-munmap option, and make it the default on Linux.
  • Add the --enable-mremap option, which disables use of mremap(2) by default.

Incompatible changes:

  • Enable stats by default.
  • Enable fill by default.
  • Disable lazy locking by default.
  • Rename the "tcache.flush" mallctl to "thread.tcache.flush".
  • Rename the "arenas.pagesize" mallctl to "arenas.page".
  • Change the "opt.lg_prof_sample" default from 0 to 19 (1 B to 512 KiB).
  • Change the "opt.prof_accum" default from true to false.

Removed features:

  • Remove the swap feature, including the "config.swap", "swap.avail",
    "swap.prezeroed", "swap.nfds", and "swap.fds" mallctls.
  • Remove highruns statistics, including the
    "stats.arenas.<i>.bins.<j>.highruns" and
    "stats.arenas.<i>.lruns.<j>.highruns" mallctls.
  • As part of small size class refactoring, remove the "opt.lg_[qc]space_max",
    "arenas.cacheline", "arenas.subpage", "arenas.[tqcs]space_{min,max}", and
    "arenas.[tqcs]bins" mallctls.
  • Remove the "arenas.chunksize" mallctl.
  • Remove the "opt.lg_prof_tcmax" option.
  • Remove the "opt.lg_prof_bt_max" option.
  • Remove the "opt.lg_tcache_gc_sweep" option.
  • Remove the --disable-tiny option, including the "config.tiny" mallctl.
  • Remove the --enable-dynamic-page-shift configure option.
  • Remove the --enable-sysv configure option.

Bug fixes:

  • Fix a statistics-related bug in the "thread.arena" mallctl that could cause
    invalid statistics and crashes.
  • Work around TLS deallocation via free() on Linux. This bug could cause
    write-after-free memory corruption.
  • Fix a potential deadlock that could occur during interval- and
    growth-triggered heap profile dumps.
  • Fix large calloc() zeroing bugs due to dropping chunk map unzeroed flags.
  • Fix chunk_alloc_dss() to stop claiming memory is zeroed. This bug could
    cause memory corruption and crashes with --enable-dss specified.
  • Fix fork-related bugs that could cause deadlock in children between fork
    and exec.
  • Fix malloc_stats_print() to honor 'b' and 'l' in the opts parameter.
  • Fix realloc(p, 0) to act like free(p).
  • Do not enforce minimum alignment in memalign().
  • Check for NULL pointer in malloc_usable_size().
  • Fix an off-by-one heap profile statistics bug that could be observed in
    interval- and growth-triggered heap profiles.
  • Fix the "epoch" mallctl to update cached stats even if the passed in epoch
    is 0.
  • Fix bin->runcur management to fix a layout policy bug. This bug did not
    affect correctness.
  • Fix a bug in choose_arena_hard() that potentially caused more arenas to be
    initialized than necessary.
  • Add missing "opt.lg_tcache_max" mallctl implementation.
  • Use glibc allocator hooks to make mixed allocator usage less likely.
  • Fix build issues for --disable-tcache.
  • Don't mangle pthread_create() when --with-private-namespace is specified.

2.2.5

18 Apr 16:47
Compare
Choose a tag to compare

Bug fixes:

  • Fix huge_ralloc() race when using mremap(2). This is a serious bug that
    could cause memory corruption and/or crashes.
  • Fix huge_ralloc() to maintain chunk statistics.
  • Fix malloc_stats_print(..., "a") output.