summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
* Purge dirty pages from the beginning of the dirty list.Qinfan Wu2014-08-121-165/+70
|
* Add dirty page counting for debugQinfan Wu2014-08-121-4/+29
|
* Maintain all the dirty runs in a linked list for each arenaQinfan Wu2014-08-121-0/+47
|
* Fix the cactive statistic.Jason Evans2014-08-071-3/+3
| | | | | | | Fix the cactive statistic to decrease (rather than increase) when active memory decreases. This regression was introduced by aa5113b1fdafd1129c22512837c6c3d66c295fc8 (Refactor overly large/complex functions) and first released in 3.5.0.
* Reintroduce the comment that was removed in f9ff603.Qinfan Wu2014-08-061-1/+5
|
* Fix the bug that causes not allocating free run with lowest address.Qinfan Wu2014-08-061-3/+7
|
* Ensure the default purgeable zone is after the default zone on OS XMike Hommey2014-06-101-9/+25
|
* Add check for madvise(2) to configure.ac.Richard Diamond2014-06-031-2/+5
| | | | | | Some platforms, such as Google's Portable Native Client, use Newlib and thus lack access to madvise(2). In those instances, pages_purge() is transformed into a no-op.
* Fix -Wsometimes-uninitialized warningsChris Peterson2014-06-021-1/+3
|
* Fix -Wsign-compare warningsChris Peterson2014-06-022-4/+4
|
* Don't catch fork()ing events for Native Client.Richard Diamond2014-06-021-1/+1
| | | | | | | | Native Client doesn't allow forking, thus there is no need to catch fork()ing events for Native Client. Additionally, without this commit, jemalloc will introduce an unresolved pthread_atfork() in PNaCl Rust bins.
* Try to use __builtin_ffsl if ffsl is unavailable.Richard Diamond2014-06-022-3/+3
| | | | | | | | | | | Some platforms (like those using Newlib) don't have ffs/ffsl. This commit adds a check to configure.ac for __builtin_ffsl if ffsl isn't found. __builtin_ffsl performs the same function as ffsl, and has the added benefit of being available on any platform utilizing Gcc-compatible compiler. This change does not address the used of ffs in the MALLOCX_ARENA() macro.
* Add size class computation capability.Jason Evans2014-05-291-29/+33
| | | | | | | Add size class computation capability, currently used only as validation of the size class lookup tables. Generalize the size class spacing used for bins, for eventual use throughout the full range of allocation sizes.
* Refactor huge allocation to be managed by arenas.Jason Evans2014-05-168-237/+256
| | | | | | | | | | | | | | | | | | | | Refactor huge allocation to be managed by arenas (though the global red-black tree of huge allocations remains for lookup during deallocation). This is the logical conclusion of recent changes that 1) made per arena dss precedence apply to huge allocation, and 2) made it possible to replace the per arena chunk allocation/deallocation functions. Remove the top level huge stats, and replace them with per arena huge stats. Normalize function names and types to *dalloc* (some were *dealloc*). Remove the --enable-mremap option. As jemalloc currently operates, this is a performace regression for some applications, but planned work to logarithmically space huge size classes should provide similar amortized performance. The motivation for this change was that mremap-based huge reallocation forced leaky abstractions that prevented refactoring.
* Add support for user-specified chunk allocators/deallocators.aravind2014-05-126-32/+124
| | | | | | | Add new mallctl endpoints "arena<i>.chunk.alloc" and "arena<i>.chunk.dealloc" to allow userspace to configure jemalloc's chunk allocator and deallocator on a per-arena basis.
* Fix coding sytle nits.Jason Evans2014-05-011-4/+4
|
* Simplify backtracing.Jason Evans2014-04-232-87/+48
| | | | | | | | | | | Simplify backtracing to not ignore any frames, and compensate for this in pprof in order to increase flexibility with respect to function-based refactoring even in the presence of non-deterministic inlining. Modify pprof to blacklist all jemalloc allocation entry points including non-standard ones like mallocx(), and ignore all allocator-internal frames. Prior to this change, pprof excluded the specifically blacklisted functions from backtraces, but it left allocator-internal frames intact.
* prof_backtrace: use unw_backtraceLucian Adrian Grijincu2014-04-231-24/+9
| | | | | | unw_backtrace: - does internal per-thread caching - doesn't acquire an internal lock
* Refactor small_size2bin and small_bin2size.Jason Evans2014-04-171-9/+9
| | | | | Refactor small_size2bin and small_bin2size to be inline functions rather than directly accessed arrays.
* Merge pull request #73 from bmaurer/smallmallocJason Evans2014-04-163-4/+111
|\ | | | | Smaller malloc hot path
| * Create a const array with only a small bin to size mapBen Maurer2014-04-161-1/+9
| |
| * refactor profiling. only use a bytes till next sample variable.Ben Maurer2014-04-161-3/+62
| |
| * outline rare tcache_get codepathsBen Maurer2014-04-161-0/+40
| |
* | Optimize Valgrind integration.Jason Evans2014-04-156-49/+104
| | | | | | | | | | | | | | | | | | | | | | Forcefully disable tcache if running inside Valgrind, and remove Valgrind calls in tcache-specific code. Restructure Valgrind-related code to move most Valgrind calls out of the fast path functions. Take advantage of static knowledge to elide some branches in JEMALLOC_VALGRIND_REALLOC().
* | Remove the "opt.valgrind" mallctl.Jason Evans2014-04-153-22/+18
| | | | | | | | | | Remove the "opt.valgrind" mallctl because it is unnecessary -- jemalloc automatically detects whether it is running inside valgrind.
* | Remove the "arenas.purge" mallctl.Jason Evans2014-04-151-27/+0
| | | | | | | | | | Remove the "arenas.purge" mallctl, which was obsoleted by the "arena.<i>.purge" mallctl in 3.1.0.
* | Make dss non-optional, and fix an "arena.<i>.dss" mallctl bug.Jason Evans2014-04-155-23/+22
| | | | | | | | | | | | | | Make dss non-optional on all platforms which support sbrk(2). Fix the "arena.<i>.dss" mallctl to return an error if "primary" or "secondary" precedence is specified, but sbrk(2) is not supported.
* | Remove the *allocm() API, which is superceded by the *allocx() API.Jason Evans2014-04-151-85/+0
|/
* Remove support for non-prof-promote heap profiling metadata.Jason Evans2014-04-113-34/+10
| | | | | | | | | | | | | | | Make promotion of sampled small objects to large objects mandatory, so that profiling metadata can always be stored in the chunk map, rather than requiring one pointer per small region in each small-region page run. In practice the non-prof-promote code was only useful when using jemalloc to track all objects and report them as leaks at program exit. However, Valgrind is at least as good a tool for this particular use case. Furthermore, the non-prof-promote code is getting in the way of some optimizations that will make heap profiling much cheaper for the predominant use case (sampling a small representative proportion of all allocations).
* Merge pull request #70 from bmaurer/bitsplitrefactorJason Evans2014-04-101-36/+40
|\ | | | | refactoring for bits splitting
| * refactoring for bits splittingBen Maurer2014-04-101-36/+40
| |
* | Don't dereference chunk->arena in free() hot pathBen Maurer2014-04-051-1/+1
|/ | | | | | | | | | | | When you call free() we load chunk->arena even though that data isn't used on the tcache hot path. In profiling some FB applications, I found that ~30% of the dTLB misses in the free() function come from this line. With 4 MB chunks, the arena_chunk_t->map is ~ 32 KB (1024 pages in the chunk, 4 8 byte pointers in arena_chunk_map_t). This means there's only a 1/8 chance of the page containing chunk->arena also comtaining the map bits.
* Merge pull request #59 from HarryWeppner/devJason Evans2014-03-291-1/+4
|\ | | | | FreeBSD memory (leak) profiling support
| * Consistently use debug lib(s) if presentHarald Weppner2014-03-281-8/+5
| | | | | | | | | | | | Fixes a situation where nm uses the debug lib but addr2line does not, which completely messes up the symbol lookup.
| * Enable profiling / leak detection in FreeBSDHarald Weppner2014-03-181-1/+7
| | | | | | | | | | * Assumes procfs is mounted at /proc, cf. <http://www.freebsd.org/doc/en/articles/linux-users/procfs.html>
* | Merge pull request #61 from mxw/huge-dss-precJason Evans2014-03-282-11/+17
|\ \ | | | | | | Use arena dss prec instead of default for huge allocs.
| * | Use arena dss prec instead of default for huge allocs.Max Wang2014-03-282-11/+17
| |/ | | | | | | | | Pass a dss_prec_t parameter to huge_{m,p,r}alloc instead of defaulting to the chunk dss prec.
* | Fix a crashing case where arena_chunk_init_hard returns NULL.Chris Pride2014-03-261-1/+4
|/ | | | | | | | | | | | | This happens when it fails to allocate a new chunk. Which arena_chunk_alloc then passes into arena_avail_insert without any checks. This then causes a crash when arena_avail_insert tries to check chunk->ndirty. This was introduced by the refactoring of arena_chunk_alloc which previously would have returned NULL immediately after calling chunk_alloc. This is now the return from arena_chunk_init_hard so we need to check that return, and not continue if it was NULL.
* Fix junk filling for mremap(2)-based huge reallocation.Jason Evans2014-02-251-0/+10
| | | | | | | If mremap(2) is used for huge reallocation, physical pages are mapped to new virtual addresses rather than data being copied to new pages. This bypasses the normal junk filling that would happen during allocation, so add junk filling that is specific to this case.
* Fix typoErwan Legrand2014-02-141-1/+0
|
* Test and fix malloc_printf("%%").Jason Evans2014-01-221-7/+6
|
* Fix unused variable warnings.Jason Evans2014-01-211-4/+2
|
* Add heap profiling tests.Jason Evans2014-01-171-13/+39
| | | | | | Fix a regression in prof_dump_ctx() due to an uninitized variable. This was caused by revision 4f37ef693e3d5903ce07dc0b61c0da320b35e3d9, so no releases are affected.
* Fix a variable prototype/definition mismatch.Jason Evans2014-01-171-2/+1
|
* Refactor prof_dump() to reduce contention.Jason Evans2014-01-161-172/+273
| | | | | | | | | | | | | | Refactor prof_dump() to use a two pass algorithm, and prof_leave() prior to the second pass. This avoids write(2) system calls while holding critical prof resources. Fix prof_dump() to close the dump file descriptor for all relevant error paths. Minimize the size of prof-related static buffers when prof is disabled. This saves roughly 65 KiB of application memory for non-prof builds. Refactor prof_ctx_init() out of prof_lookup_global().
* Refactor prof_lookup() by extracting prof_lookup_global().Jason Evans2014-01-151-82/+79
|
* Refactor overly large/complex functions.Jason Evans2014-01-151-383/+461
| | | | | | | Refactor overly large functions by breaking out helper functions. Refactor overly complex multi-purpose functions into separate more specific functions.
* Extract profiling code from [re]allocation functions.Jason Evans2014-01-123-367/+460
| | | | | | | | | | | | | | | | | | | Extract profiling code from malloc(), imemalign(), calloc(), realloc(), mallocx(), rallocx(), and xallocx(). This slightly reduces the amount of code compiled into the fast paths, but the primary benefit is the combinatorial complexity reduction. Simplify iralloc[t]() by creating a separate ixalloc() that handles the no-move cases. Further simplify [mrxn]allocx() (and by implication [mrn]allocm()) to make request size overflows due to size class and/or alignment constraints trigger undefined behavior (detected by debug-only assertions). Report ENOMEM rather than EINVAL if an OOM occurs during heap profiling backtrace creation in imemalign(). This bug impacted posix_memalign() and aligned_alloc().
* Add junk/zero filling unit tests, and fix discovered bugs.Jason Evans2014-01-082-19/+92
| | | | | | Fix growing large reallocation to junk fill new space. Fix huge deallocation to junk fill when munmap is disabled.
* Add util unit tests, and fix discovered bugs.Jason Evans2014-01-071-28/+36
| | | | | | | | | | | | | Add unit tests for pow2_ceil(), malloc_strtoumax(), and malloc_snprintf(). Fix numerous bugs in malloc_strotumax() error handling/reporting. These bugs could have caused application-visible issues for some seldom used (0X... and 0... prefixes) or malformed MALLOC_CONF or mallctl() argument strings, but otherwise they had no impact. Fix numerous bugs in malloc_snprintf(). These bugs were not exercised by existing malloc_*printf() calls, so they had no impact.