- Dec 12, 2012
-
-
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.
-
- Nov 30, 2012
-
-
Jason Evans authored
Reported by Mike Hommey.
-
- Nov 25, 2012
-
-
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.
-
- Nov 13, 2012
-
-
Jason Evans authored
Refactor arena_prof_accum() and its callers to avoid arena locking when prof_interval is 0 (as when profiling is disabled). Reported by Ben Maurer.
-
- Nov 09, 2012
-
-
Jason Evans authored
-
- Nov 07, 2012
-
-
Jason Evans authored
Tweak chunk purge order to purge unfragmented chunks from high to low memory. This facilitates dirty run reuse.
-
Mike Hommey authored
-
- Nov 06, 2012
-
-
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.
-
- Nov 04, 2012
-
-
Jason Evans authored
Fix deadlock in the arenas.purge mallctl due to recursive mutex acquisition.
-
- Oct 17, 2012
-
-
Jason Evans authored
Fix dss/mmap allocation precedence code to use recyclable mmap memory only after primary dss allocation fails.
-
- Oct 16, 2012
-
-
Jason Evans authored
-
- Oct 15, 2012
-
-
Jason Evans authored
Add ctl_mutex proection to arena_i_dss_ctl(), since ctl_stats.narenas is accessed.
-
- Oct 13, 2012
-
-
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.
-
- Oct 10, 2012
-
-
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.
-
Jason Evans authored
Use JEMALLOC_USABLE_SIZE_CONST for the malloc_usable_size() implementation as well as the prototype, for consistency's sake.
-
Jason Evans authored
Drop const from malloc_usable_size() argument on Linux, in order to match the prototype in Linux's malloc.h.
-
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.
-
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.
-
- Oct 09, 2012
-
-
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.
-
Jason Evans authored
Reported by Corey Richardson.
-
Corey Richardson authored
-
Corey Richardson authored
-
Jason Evans authored
Submitted by Jory Pratt.
-
- May 24, 2012
-
-
Jason Evans authored
Remove const from __*_hook variable declarations, so that glibc can modify them during process forking.
-
- May 16, 2012
-
-
Jason Evans authored
-
Jason Evans authored
Disable tcache by default if running inside Valgrind, in order to avoid making unallocated objects appear reachable to Valgrind.
-
- May 15, 2012
-
-
Jason Evans authored
Auto-detect whether running inside Valgrind, thus removing the need to manually specify MALLOC_CONF=valgrind:true.
-
Jason Evans authored
Fix prof_realloc() to not call prof_ctx_set() if a sampled object is being freed via realloc(p, 0).
-
- May 12, 2012
-
-
Jason Evans authored
-
Jason Evans authored
Avoid mutex operations in _malloc_{pre,post}fork() unless jemalloc has been initialized. Reported by David Xu.
-
- May 11, 2012
-
-
Jason Evans authored
Refactor code such that arena_mapbits_{large,small}_set() always preserves the unzeroed flag, and manually manipulate the unzeroed flag in the one case where it actually gets reset (in arena_chunk_purge()). This fixes unzeroed preservation bugs in arena_run_split() and arena_ralloc_large_grow(). These bugs caused large calloc() to return non-zeroed memory under some circumstances.
-
Jason Evans authored
-
Jason Evans authored
Refactor duplicated arena_run_alloc() code into arena_run_alloc_helper().
-
- May 10, 2012
-
-
Jason Evans authored
-
Jason Evans authored
Generalize "stats.mapped" documentation to state that all inactive chunks are omitted, now that it is possible for mmap'ed chunks to be omitted in addition to DSS chunks.
-
Mike Hommey authored
da99e311 removed attributes on je_memalign and je_valloc, while they didn't have a definition in the jemalloc.h header, thus making them non-exported. Export them again, by defining them in the jemalloc.h header.
-
Mike Hommey authored
It doesn't allow the je_malloc_message and je_malloc_conf symbols to be overridden when linking statically.
-
Jason Evans authored
Add the --enable-mremap option, and disable the use of mremap(2) by default, for the same reason that freeing chunks via munmap(2) is disabled by default on Linux: semi-permanent VM map fragmentation.
-
- May 09, 2012
-
-
Jason Evans authored
Fix chunk_recycle() to correctly compute trailsize and re-insert trailing chunks. This fixes a major virtual memory leak. Simplify chunk_record() to avoid dropping/re-acquiring chunks_mtx.
-