Go to file
Daniel Micay 879e76a9e5 teach the dss chunk allocator to handle new_addr
This provides in-place expansion of huge allocations when the end of the
allocation is at the end of the sbrk heap. There's already the ability
to extend in-place via recycled chunks but this handles the initial
growth of the heap via repeated vector / string reallocations.

A possible future extension could allow realloc to go from the following:

    | huge allocation | recycled chunks |
                                        ^ dss_end

To a larger allocation built from recycled *and* new chunks:

    |                      huge allocation                      |
                                                                ^ dss_end

Doing that would involve teaching the chunk recycling code to request
new chunks to satisfy the request. The chunk_dss code wouldn't require
any further changes.

    #include <stdlib.h>

    int main(void) {
        size_t chunk = 4 * 1024 * 1024;
        void *ptr = NULL;
        for (size_t size = chunk; size < chunk * 128; size *= 2) {
            ptr = realloc(ptr, size);
            if (!ptr) return 1;
        }
    }

dss:secondary: 0.083s
dss:primary: 0.083s

After:

dss:secondary: 0.083s
dss:primary: 0.003s

The dss heap grows in the upwards direction, so the oldest chunks are at
the low addresses and they are used first. Linux prefers to grow the
mmap heap downwards, so the trick will not work in the *current* mmap
chunk allocator as a huge allocation will only be at the top of the heap
in a contrived case.
2014-11-28 16:11:19 -08:00
bin Add sdallocx() to list of functions to prune in pprof. 2014-09-10 08:49:29 -07:00
doc Fix huge allocation statistics. 2014-10-14 22:20:00 -07:00
include teach the dss chunk allocator to handle new_addr 2014-11-28 16:11:19 -08:00
src teach the dss chunk allocator to handle new_addr 2014-11-28 16:11:19 -08:00
test Thwart compiler optimizations. 2014-10-15 14:49:14 -07:00
.autom4te.cfg Disable autom4te cache. 2014-09-02 17:49:29 -07:00
.gitattributes fix git handling of newlines on windows 2014-05-07 18:48:39 -04:00
.gitignore Ignore jemalloc.pc . 2014-09-21 21:40:38 -07:00
autogen.sh Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
ChangeLog Update ChangeLog for 3.6.0. 2014-03-31 09:23:10 -07:00
config.guess Update config.{guess,sub} to more recent versions, to add better support to OpenRISC/or1k (among others) 2014-07-29 23:15:26 +01:00
config.stamp.in Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
config.sub Fixed iOS build after OR1 changes 2014-09-12 07:24:28 +03:00
configure.ac Fix variable declaration with no type in the configure script. 2014-10-20 14:08:37 -02:00
COPYING Update copyrights. 2014-01-22 11:09:04 -08:00
coverage.sh Add test code coverage analysis. 2013-12-06 18:50:51 -08:00
INSTALL Fix line wrapping. 2014-10-14 22:31:49 -07:00
install-sh Move repo contents in jemalloc/ to top level. 2011-03-31 20:36:17 -07:00
jemalloc.pc.in Generate a pkg-config file 2014-09-19 22:27:35 +01:00
Makefile.in Add configure options. 2014-10-09 22:44:37 -07:00
README Update README. 2013-10-20 19:38:19 -07:00

jemalloc is a general purpose malloc(3) implementation that emphasizes
fragmentation avoidance and scalable concurrency support.  jemalloc first came
into use as the FreeBSD libc allocator in 2005, and since then it has found its
way into numerous applications that rely on its predictable behavior.  In 2010
jemalloc development efforts broadened to include developer support features
such as heap profiling, Valgrind integration, and extensive monitoring/tuning
hooks.  Modern jemalloc releases continue to be integrated back into FreeBSD,
and therefore versatility remains critical.  Ongoing development efforts trend
toward making jemalloc among the best allocators for a broad range of demanding
applications, and eliminating/mitigating weaknesses that have practical
repercussions for real world applications.

The COPYING file contains copyright and licensing information.

The INSTALL file contains information on how to configure, build, and install
jemalloc.

The ChangeLog file contains a brief summary of changes for each release.

URL: http://www.canonware.com/jemalloc/