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.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
|
||||
#ifdef JEMALLOC_PROF
|
||||
const char *malloc_conf =
|
||||
"prof:true,prof_thread_active_init:false,lg_prof_sample:0,prof_final:false";
|
||||
"prof:true,prof_thread_active_init:false,lg_prof_sample:0";
|
||||
#endif
|
||||
|
||||
static void
|
||||
|
@@ -1,8 +1,7 @@
|
||||
#include "test/jemalloc_test.h"
|
||||
|
||||
#ifdef JEMALLOC_PROF
|
||||
const char *malloc_conf =
|
||||
"prof:true,prof_active:false,prof_final:false";
|
||||
const char *malloc_conf = "prof:true,prof_active:false";
|
||||
#endif
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user