Skip to content
  1. Jan 23, 2013
  2. Jan 22, 2013
    • Jason Evans's avatar
      Update phony targets. · 42ba90eb
      Jason Evans authored
      Submitted by Frederik Deweerdt.
      42ba90eb
    • Jason Evans's avatar
      Use config_* instead of JEMALLOC_*. · ba175a2b
      Jason Evans authored
      Convert a couple of stragglers from JEMALLOC_* to use config_*.
      ba175a2b
    • Jason Evans's avatar
      Update hash from MurmurHash2 to MurmurHash3. · ae03bf6a
      Jason Evans authored
      Update hash from MurmurHash2 to MurmurHash3, primarily because the
      latter generates 128 bits in a single call for no extra cost, which
      simplifies integration with cuckoo hashing.
      ae03bf6a
    • Jason Evans's avatar
      Fix AC_PATH_PROG() calls to specify default. · 7329a4f0
      Jason Evans authored
      Fix AC_PATH_PROG() calls to specify 'false' as the default, so that if
      the configure script fails to find a program, the false program is
      instead called, and an error occurs.  Prior to this fix, if xsltproc
      could not be found, make would not report an error due to the leading -o
      in the xsltproc invocation.
      
      Reported by David Reiss.
      7329a4f0
    • Jason Evans's avatar
      Add and use JEMALLOC_ALWAYS_INLINE. · 88393cb0
      Jason Evans authored
      Add JEMALLOC_ALWAYS_INLINE and use it to guarantee that the entire fast
      paths of the primary allocation/deallocation functions are inlined.
      88393cb0
    • Jason Evans's avatar
      Tighten valgrind integration. · 38067483
      Jason Evans authored
      Tighten valgrind integration such that immediately after memory is
      validated or zeroed, valgrind is told to forget the memory's 'defined'
      state.  The only place newly allocated memory should be left marked as
      'defined' is in the public functions (e.g. calloc() and realloc()).
      38067483
    • Jason Evans's avatar
      Avoid validating freshly mapped memory. · 14a2c6a6
      Jason Evans authored
      Move validation of supposedly zeroed pages from chunk_alloc() to
      chunk_recycle().  There is little point to validating newly mapped
      memory returned by chunk_alloc_mmap(), and memory that comes from sbrk()
      is explicitly zeroed, so there is little risk to assuming that
      chunk_alloc_dss() actually does the zeroing properly.
      
      This relaxation of validation can make a big difference to application
      startup time and overall system usage on platforms that use jemalloc as
      the system allocator (namely FreeBSD).
      
      Submitted by Ian Lepore <ian@FreeBSD.org>.
      14a2c6a6
  3. Dec 24, 2012
  4. Dec 23, 2012
  5. Dec 12, 2012
    • Jason Evans's avatar
      Fix chunk_recycle() Valgrind integration. · 1271185b
      Jason Evans authored
      Fix chunk_recycyle() to unconditionally inform Valgrind that returned
      memory is undefined.  This fixes Valgrind warnings that would result
      from a huge allocation being freed, then recycled for use as an arena
      chunk.  The arena code would write metadata to the chunk header, and
      Valgrind would consider these invalid writes.
      1271185b
  6. Nov 30, 2012
  7. Nov 25, 2012
    • Mike Hommey's avatar
      Allow to build without exporting symbols · 9906660e
      Mike Hommey authored
      When statically linking jemalloc, it may be beneficial not to export its
      symbols if it makes sense, which allows the compiler and the linker to do
      some further optimizations.
      9906660e
  8. Nov 13, 2012
  9. Nov 09, 2012
  10. Nov 07, 2012
  11. Nov 06, 2012
    • Jason Evans's avatar
      Purge unused dirty pages in a fragmentation-reducing order. · e3d13060
      Jason Evans authored
      Purge unused dirty pages in an order that first performs clean/dirty run
      defragmentation, in order to mitigate available run fragmentation.
      
      Remove the limitation that prevented purging unless at least one chunk
      worth of dirty pages had accumulated in an arena.  This limitation was
      intended to avoid excessive purging for small applications, but the
      threshold was arbitrary, and the effect of questionable utility.
      
      Relax opt_lg_dirty_mult from 5 to 3.  This compensates for increased
      likelihood of allocating clean runs, given the same ratio of clean:dirty
      runs, and reduces the potential for repeated purging in pathological
      large malloc/free loops that push the active:dirty page ratio just over
      the purge threshold.
      e3d13060
  12. Nov 04, 2012
  13. Oct 17, 2012
  14. Oct 16, 2012
  15. Oct 15, 2012
  16. Oct 13, 2012
    • Jason Evans's avatar
      Add arena-specific and selective dss allocation. · 609ae595
      Jason Evans authored
      Add the "arenas.extend" mallctl, so that it is possible to create new
      arenas that are outside the set that jemalloc automatically multiplexes
      threads onto.
      
      Add the ALLOCM_ARENA() flag for {,r,d}allocm(), so that it is possible
      to explicitly allocate from a particular arena.
      
      Add the "opt.dss" mallctl, which controls the default precedence of dss
      allocation relative to mmap allocation.
      
      Add the "arena.<i>.dss" mallctl, which makes it possible to set the
      default dss precedence on a per arena or global basis.
      
      Add the "arena.<i>.purge" mallctl, which obsoletes "arenas.purge".
      
      Add the "stats.arenas.<i>.dss" mallctl.
      609ae595
  17. Oct 10, 2012
    • Jan Beich's avatar
      mark _pthread_mutex_init_calloc_cb as public explicitly · d0ffd8ed
      Jan Beich authored
      Mozilla build hides everything by default using visibility pragma and
      unhides only explicitly listed headers. But this doesn't work on FreeBSD
      because _pthread_mutex_init_calloc_cb is neither documented nor exposed
      via any header.
      d0ffd8ed
    • Jason Evans's avatar
      Make malloc_usable_size() implementation consistent with prototype. · 2cc11ff8
      Jason Evans authored
      Use JEMALLOC_USABLE_SIZE_CONST for the malloc_usable_size()
      implementation as well as the prototype, for consistency's sake.
      2cc11ff8
    • Jason Evans's avatar
      Drop const from malloc_usable_size() argument on Linux. · 247d1248
      Jason Evans authored
      Drop const from malloc_usable_size() argument on Linux, in order to
      match the prototype in Linux's malloc.h.
      247d1248
    • Jason Evans's avatar
      Fix fork(2)-related mutex acquisition order. · b5225928
      Jason Evans authored
      Fix mutex acquisition order inversion for the chunks rtree and the base
      mutex.  Chunks rtree acquisition was introduced by the previous commit,
      so this bug was short-lived.
      b5225928
    • Jason Evans's avatar
      Fix fork(2)-related deadlocks. · 20f1fc95
      Jason Evans authored
      Add a library constructor for jemalloc that initializes the allocator.
      This fixes a race that could occur if threads were created by the main
      thread prior to any memory allocation, followed by fork(2), and then
      memory allocation in the child process.
      
      Fix the prefork/postfork functions to acquire/release the ctl, prof, and
      rtree mutexes.  This fixes various fork() child process deadlocks, but
      one possible deadlock remains (intentionally) unaddressed: prof
      backtracing can acquire runtime library mutexes, so deadlock is still
      possible if heap profiling is enabled during fork().  This deadlock is
      known to be a real issue in at least the case of libgcc-based
      backtracing.
      
      Reported by tfengjun.
      20f1fc95
  18. Oct 09, 2012
    • Jason Evans's avatar
      Fix mlockall()/madvise() interaction. · 7de92767
      Jason Evans authored
      mlockall(2) can cause purging via madvise(2) to fail.  Fix purging code
      to check whether madvise() succeeded, and base zeroed page metadata on
      the result.
      
      Reported by Olivier Lecomte.
      7de92767