summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2014-10-09 00:57:19 (GMT)
committerJason Evans <jasone@canonware.com>2014-10-09 01:08:00 (GMT)
commit57efa7bb0e284805c940472190bc9924327635a1 (patch)
treeb6fd6d6d848197576affa3385004ca5e49f74fac /doc
parent3a8b9b1fd95b1bb9b3dc00f6798eeb40d5100b7b (diff)
downloadjemalloc-57efa7bb0e284805c940472190bc9924327635a1.zip
jemalloc-57efa7bb0e284805c940472190bc9924327635a1.tar.gz
jemalloc-57efa7bb0e284805c940472190bc9924327635a1.tar.bz2
Avoid atexit(3) when possible, disable prof_final by default.
atexit(3) can deadlock internally during its own initialization if jemalloc calls atexit() during jemalloc initialization. Mitigate the impact by restructuring prof initialization to avoid calling atexit() unless the registered function will actually dump a final heap profile. Additionally, disable prof_final by default so that this land mine is opt-in rather than opt-out. This resolves #144.
Diffstat (limited to 'doc')
-rw-r--r--doc/jemalloc.xml.in18
1 files changed, 15 insertions, 3 deletions
diff --git a/doc/jemalloc.xml.in b/doc/jemalloc.xml.in
index 1f692f7..7da1498 100644
--- a/doc/jemalloc.xml.in
+++ b/doc/jemalloc.xml.in
@@ -857,8 +857,14 @@ for (i = 0; i < nbins; i++) {
<option>--enable-stats</option> is specified during configuration, this
has the potential to cause deadlock for a multi-threaded process that
exits while one or more threads are executing in the memory allocation
- functions. Therefore, this option should only be used with care; it is
- primarily intended as a performance tuning aid during application
+ functions. Furthermore, <function>atexit<parameter/></function> may
+ allocate memory during application initialization and then deadlock
+ internally when jemalloc in turn calls
+ <function>atexit<parameter/></function>, so this option is not
+ univerally usable (though the application can register its own
+ <function>atexit<parameter/></function> function with equivalent
+ functionality). Therefore, this option should only be used with care;
+ it is primarily intended as a performance tuning aid during application
development. This option is disabled by default.</para></listitem>
</varlistentry>
@@ -1155,7 +1161,13 @@ malloc_conf = "xmalloc:true";]]></programlisting>
<filename>&lt;prefix&gt;.&lt;pid&gt;.&lt;seq&gt;.f.heap</filename>,
where <literal>&lt;prefix&gt;</literal> is controlled by the <link
linkend="opt.prof_prefix"><mallctl>opt.prof_prefix</mallctl></link>
- option. This option is enabled by default.</para></listitem>
+ option. Note that <function>atexit<parameter/></function> may allocate
+ memory during application initialization and then deadlock internally
+ when jemalloc in turn calls <function>atexit<parameter/></function>, so
+ this option is not univerally usable (though the application can
+ register its own <function>atexit<parameter/></function> function with
+ equivalent functionality). This option is disabled by
+ default.</para></listitem>
</varlistentry>
<varlistentry id="opt.prof_leak">