Embed one or more library paths, so that libjemalloc can find the libraries
it is linked to. This works only on ELF-based systems.
+--with-mangling=<map>
+ Mangle public symbols specified in <map> which is a comma-separated list of
+ name:mangled pairs.
+
+ For example, to use ld's --wrap option as an alternative method for
+ overriding libc's malloc implementation, specify something like:
+
+ --with-mangling=malloc:__wrap_malloc,free:__wrap_free[...]
+
+ Note that mangling happens prior to application of the prefix specified by
+ --with-jemalloc-prefix, and mangled symbols are then ignored when applying
+ the prefix.
+
--with-jemalloc-prefix=<prefix>
Prefix all public APIs with <prefix>. For example, if <prefix> is
"prefix_", API changes like the following occur:
jemalloc overlays the default malloc zone, but makes no attempt to actually
replace the "malloc", "calloc", etc. symbols.
+--with-private-namespace=<prefix>
+ Prefix all library-private APIs with <prefix>. For shared libraries,
+ symbol visibility mechanisms prevent these symbols from being exported, but
+ for static libraries, naming collisions are a real possibility. By
+ default, the prefix is "" (empty string).
+
--with-install-suffix=<suffix>
Append <suffix> to the base name of all installed files, such that multiple
versions of jemalloc can coexist in the same installation directory. For
Enable assertions and validation code. This incurs a substantial
performance hit, but is very useful during application development.
---enable-stats
- Enable statistics gathering functionality. See the "opt.stats_print"
+--disable-stats
+ Disable statistics gathering functionality. See the "opt.stats_print"
option documentation for usage details.
--enable-prof
Statically link against the specified libunwind.a rather than dynamically
linking with -lunwind.
---disable-tiny
- Disable tiny (sub-quantum-sized) object support. Technically it is not
- legal for a malloc implementation to allocate objects with less than
- quantum alignment (8 or 16 bytes, depending on architecture), but in
- practice it never causes any problems if, for example, 4-byte allocations
- are 4-byte-aligned.
-
--disable-tcache
Disable thread-specific caches for small objects. Objects are cached and
released in bulk, thus reducing the total number of mutex operations. See
the "opt.tcache" option for usage details.
---enable-swap
- Enable mmap()ed swap file support. When this feature is built in, it is
- possible to specify one or more files that act as backing store. This
- effectively allows for per application swap files.
+--enable-mremap
+ Enable huge realloc() via mremap(2). mremap() is disabled by default
+ because the flavor used is specific to Linux, which has a quirk in its
+ virtual memory allocation algorithm that causes semi-permanent VM map holes
+ under normal jemalloc operation.
+
+--disable-munmap
+ Disable virtual memory deallocation via munmap(2); instead keep track of
+ the virtual memory for later use. munmap() is disabled by default (i.e.
+ --disable-munmap is implied) on Linux, which has a quirk in its virtual
+ memory allocation algorithm that causes semi-permanent VM map holes under
+ normal jemalloc operation.
--enable-dss
Enable support for page allocation/deallocation via sbrk(2), in addition to
mmap(2).
---enable-fill
- Enable support for junk/zero filling of memory. See the "opt.junk"/
- "opt.zero" option documentation for usage details.
+--disable-fill
+ Disable support for junk/zero filling of memory, quarantine, and redzones.
+ See the "opt.junk", "opt.zero", "opt.quarantine", and "opt.redzone" option
+ documentation for usage details.
+
+--disable-valgrind
+ Disable support for Valgrind.
+
+--disable-experimental
+ Disable support for the experimental API (*allocm()).
+
+--enable-utrace
+ Enable utrace(2)-based allocation tracing. This feature is not broadly
+ portable (FreeBSD has it, but Linux and OS X do not).
--enable-xmalloc
Enable support for optional immediate termination due to out-of-memory
errors, as is commonly implemented by "xmalloc" wrapper function for malloc.
See the "opt.xmalloc" option documentation for usage details.
---enable-sysv
- Enable support for System V semantics, wherein malloc(0) returns NULL
- rather than a minimal allocation. See the "opt.sysv" option documentation
- for usage details.
-
---enable-dynamic-page-shift
- Under most conditions, the system page size never changes (usually 4KiB or
- 8KiB, depending on architecture and configuration), and unless this option
- is enabled, jemalloc assumes that page size can safely be determined during
- configuration and hard-coded. Enabling dynamic page size determination has
- a measurable impact on performance, since the compiler is forced to load
- the page size from memory rather than embedding immediate values.
-
---disable-lazy-lock
- Disable code that wraps pthread_create() to detect when an application
+--enable-lazy-lock
+ Enable code that wraps pthread_create() to detect when an application
switches from single-threaded to multi-threaded mode, so that it can avoid
mutex locking/unlocking operations while in single-threaded mode. In
practice, this feature usually has little impact on performance unless
=== Advanced compilation =======================================================
+To build only parts of jemalloc, use the following targets:
+
+ build_lib_shared
+ build_lib_static
+ build_lib
+ build_doc_html
+ build_doc_man
+ build_doc
+
To install only parts of jemalloc, use the following targets:
install_bin
install_include
+ install_lib_shared
+ install_lib_static
install_lib
+ install_doc_html
+ install_doc_man
install_doc
To clean up build results to varying degrees, use the following make targets:
The manual page is generated in both html and roff formats. Any web browser
can be used to view the html manual. The roff manual page can be formatted
-prior to installation via any of the following commands:
+prior to installation via the following command:
nroff -man -t doc/jemalloc.3
-
- groff -man -t -Tps doc/jemalloc.3 | ps2pdf - doc/jemalloc.3.pdf
-
- (cd doc; groff -man -man-ext -t -Thtml jemalloc.3 > jemalloc.3.html)