summaryrefslogtreecommitdiffstats
path: root/jemalloc/src/jemalloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Implement sampling for heap profiling.Jason Evans2010-03-021-5/+14
|
* Restructure source tree.Jason Evans2010-02-111-1/+1
|
* Remove tracing (--enable-trace).Jason Evans2010-02-111-77/+9
| | | | | | | Remove all functionality related to tracing. This functionality was useful for understanding memory fragmentation during early algorithmic design of jemalloc, but it had little utility for non-trivial applications, due to the sheer volume of data written to disk.
* Implement interval-based heap profile dumping.Jason Evans2010-02-111-7/+3
| | | | | | Add mallctl interfaces for profiling parameters. Fix a file descriptor leak in heap profile dumping.
* Fix a profiling bootstrap bug.Jason Evans2010-02-111-8/+12
| | | | | Bootstrap profiling in three stages, so that it is usable by the time the first application allocation occurs.
* Implement allocation profiling and leack checking.Jason Evans2010-02-101-125/+188
| | | | | | | | | | | | | | Add the --enable-prof and --enable-prof-libunwind configure options. Add the B/b, F/f, I/i, L/l, and U/u JEMALLOC_OPTIONS. Interval-based profile dump triggering is not yet implemented. Add supporting generic code: * Add memory barriers. * Add prn (LCG PRNG). * Add hash (Murmur hash function). * Add ckh (cuckoo hash tables).
* Fix bootstrapping crash.Jason Evans2010-01-291-10/+20
| | | | | | | | | | | | | If a custom small_size2bin table was required due to non-default size class settings, memory allocation prior to initializing chunk parameters would cause a crash due to division by 0. The fix re-orders the various *_boot() function calls. Bootstrapping is simpler now than it was before the base allocator started just using the chunk allocator directly. This allows arena_boot[01]() to be combined. Add error detection for pthread_atfork() and atexit() function calls.
* Remove tcache bin sorting during flush.Jason Evans2010-01-291-8/+0
| | | | | This feature caused significant performance degradation, and the fragmentation reduction benefits were difficult to quantify.
* madvise(..., MADV_{RANODOM,NOSYNC}) swap files.Jason Evans2010-01-271-0/+9
| | | | Initialize malloc before calling into the ctl_*() functions.
* Implement mallctl{nametomib,bymib}().Jason Evans2010-01-271-21/+40
| | | | | | | | | | | | | Replace chunk stats code that was missing locking; this fixes a race condition that could corrupt chunk statistics. Converting malloc_stats_print() to use mallctl*(). Add a missing semicolon in th DSS code. Convert malloc_tcache_flush() to a mallctl. Convert malloc_swap_enable() to a set of mallctl's.
* Simplify malloc_{pre,post}fork().Jason Evans2010-01-251-37/+9
| | | | | | Revert to simpler lock acquistion/release code in malloc_{pre,post}fork(), since dynamic arena rebalancing is no longer implemented.
* Add the --enable-swap configure option.Jason Evans2010-01-241-0/+42
| | | | | | | | Add malloc_swap_enable(). Add the O/o JEMALLOC_OPTIONS flags, which control memory overcommit. Fix mapped memory stats reporting for arenas.
* Add the w4opaque argument to numerous functions.Jason Evans2010-01-191-5/+6
| | | | | Add the w4opaque argument malloc_message() and malloc_stats_print(), and propagate the change through all the internal APIs as necessary.
* Add the write4 parameter to malloc_stats_print().Jason Evans2010-01-171-1/+1
| | | | Add malloc_cprintf() and malloc_vcprintf().
* Add the --with-install-suffix configure option.Jason Evans2010-01-171-1/+1
| | | | Fix some bugs in the Makefile's install target.
* Refactor jemalloc.c into multiple source files.Jason Evans2010-01-161-5464/+100
| | | | | | | | | Fix a stats bug in large object curruns accounting. Replace tcache_bin_fill() with arena_tcache_fill(), and fix a bug in an OOM error path. Fix API name mangling to coexist with __attribute__((malloc)).
* Support malloc() even after tcache destruction has occurred, since other tsdJason Evans2010-01-131-12/+11
| | | | destructors may run after tcache_tsd's.
* Add the S/s JEMALLOC_OPTIONS flags to enable/disable tcache bin sorting.Jason Evans2010-01-041-1/+13
|
* Enhance the H/h MALLOC_OPTIONS flags to control the number of tcache bin slots,Jason Evans2010-01-041-60/+73
| | | | | | rather than just enabling/disabling the tcache. Fix an off-by-one bug in large object stats recording.
* Enhance the G/g MALLOC_OPTIONS flags to control GC sweep interval, rather thanJason Evans2010-01-031-12/+35
| | | | just enabling/disabling GC.
* Split run deallocation out of arena_dalloc_bin(), into arena_dalloc_bin_run().Jason Evans2010-01-031-47/+89
| | | | | | | | | | | | | Enhance bin run deallocation to avoid marking all pages as dirty, since the dirty bits are already correct for all but the first page, due to the use of arena_run_rc_{incr,decr}(). This tends to dramatically reduce the number of pages that are marked dirty. Modify arena_bin_run_size_calc() to assure that bin run headers never exceed one page. In practice, this can't happen unless hard-coded constants (related to RUN_MAX_OVRHD) are modified, but the dirty page tracking code assumes bin run headers never extend past the first page, so it seems worth making this a universally valid assumption.
* Make malloc_stats_print() a public symbol, and make it repeatedly callable.Jason Evans2010-01-031-370/+432
| | | | | Incrementally merge tcache stats, so that malloc_stats_print() always reports at least most events that have occurred thus far.
* Simplify JEMALLOC_ATTR_* macros to become JEMALLOC_ATTR().Jason Evans2010-01-031-13/+22
| | | | | | | | | | | Use JEMALLOC_ATTR(tls_model("initial-exec)) instead of -ftls-model=initial-exec so that libjemalloc_pic.a can be directly linked into another library without needing linker options changes. Add attributes to malloc, calloc, and posix_memalign, for compatibility with glibc's declarations. Add function prototypes for the standard malloc(3) API.
* Add the COPYING file, and consolidate copyright/licensing information.Jason Evans2010-01-031-57/+0
|
* Implement per size class stats collection for large objects.Jason Evans2009-12-291-52/+150
|
* Base maximum dirty page count on proportion of active memory.Jason Evans2009-12-291-66/+243
| | | | | | Add dirty page tracking for pages within active small/medium object runs. Reduce chunks_dirty red-black tree operations via lazy updating.
* Use "lg" prefix rather than "2pow" suffix to indicate base 2 logarithms.Jason Evans2009-12-291-117/+112
| | | | Remove the default definition for SIZEOF_INT_2POW.
* Modify pthread_create() wrapper such that isthreaded is only set once.Jason Evans2009-12-291-3/+7
|
* Handle 0-size allocation requests in posix_memalign().Jason Evans2009-12-291-2/+36
|
* Convert thread-specific caching from magazines, and implement incremental GC.Jason Evans2009-12-291-363/+550
| | | | | | | | Add the 'G'/'g' and 'H'/'h' MALLOC_OPTIONS flags. Add the malloc_tcache_flush() function. Disable thread-specific caching until the application goes multi-threaded.
* Add support for medium size classes, [4KiB..32KiB], 2KiB apart by default.Jason Evans2009-12-291-253/+436
| | | | | | | | | | | Add the 'M' and 'm' MALLOC_OPTIONS flags, which control the maximum medium size class. Relax the cap on small/medium run size to arena_maxclass. Reduce arena_run_reg_dalloc() integer division code complexity. Increase the default chunk size from 1MiB to 4MiB.
* Remove opt_dss and opt_mmap, such that if DSS allocation is enabled, both DSSJason Evans2009-12-291-65/+18
| | | | and heap allocation are always enabled.
* Streamline the fast path for magazine-based allocation/deallocation.Jason Evans2009-12-291-60/+118
|
* Remove the dynamic rebalancing code, since magazines reduce its utility.Jason Evans2009-12-291-378/+69
|
* Implement thread-aware allocation event tracing.Jason Evans2009-12-291-185/+480
|
* Add --with-jemalloc-prefix, which supports API mangling.Jason Evans2009-12-291-54/+56
| | | | Rename jemalloc_options-->malloc_options and jemalloc_message-->malloc_message.
* Use __restrict rather than restrict.Jason Evans2009-12-291-4/+5
|
* Make sure that there are no more than 256 size clases, since size2bin can onlyJason Evans2009-11-131-0/+11
| | | | encode bin indices in [0..255].
* Integrate architecture portability fixes.Jason Evans2009-11-091-1/+4
| | | | Submitted by: Ingvar Hagelund
* Fix configure docs (--enable-lazy-lock --> --disable-lazy-lock).Jason Evans2009-11-091-3/+3
| | | | | | Fix some style nits. Ignore the jemalloc/bin directory.
* _pt_thread_death_internal(), which is part of Linux's nptl pthreadsJason Evans2009-11-091-9/+22
| | | | | | | implementation, calls free() after calling TSD destructors. This was causing a crash during thread exit, since the magazine rack was no longer valid for the thread. Fix this by using a special mag_rack value to indicate that deallocation should bypass the magazine machinery.
* Modify chunk_alloc_mmap() to support address space layout randomization (ASLR).Jason Evans2009-11-091-51/+100
|
* Update assertions in realloc() and free() to allow for deallocation duringJason Evans2009-11-091-4/+6
| | | | initializtion.
* Integrate mtrgraph and mtrplay.Jason Evans2009-07-021-1/+1
|
* Add configure tests for CFLAGS settings.Jason Evans2009-06-301-5/+5
| | | | | | Add configure test for __asm__ syntax. Add configure test for __attribute__ syntax.
* Fix various compiler warnings.Jason Evans2009-06-291-17/+9
| | | | Reported by: Mark Rabkin
* Minor documentation and comment cleanups.Jason Evans2009-06-261-6/+17
|
* Clean up the manpage and conditionalize various portions according to howJason Evans2009-06-261-28/+24
| | | | | | | | | | | | jemalloc is configured. Modify arena_malloc() API to avoid unnecessary choose_arena() calls. Remove unnecessary code from choose_arena(). Enable lazy-lock by default, now that choose_arena() is both faster and out of the critical path. Implement objdir support in the build system.
* Implement configuration system.Jason Evans2009-06-241-349/+445
| | | | | | | | | | | | | | | | | | | | | Implement minimal Makefile. Make compile-time-optional jemalloc features controllable via configure options (debug, stats, tiny, mag, balance, dss). Conditionally exclude most of the opt_* run-time options, based on configure options (fill, xmalloc, sysv). Implement optional --enable-dynamic-page-shift. Implement optional --enable-lazy-lock. Re-order malloc_init_hard() and use the malloc_initializer variable to support recursive allocation in malloc_ncpus(). Add mag_rack_tsd in order to receive notifications of thread termination. Add jemalloc.h.
* Fix various namespace issues.Jason Evans2009-06-231-77/+99
|