Memory Leak in Thread Cleanup (jemalloc 4.0.4)
jasone at canonware.com
Sat Feb 27 21:33:13 PST 2016
On Feb 11, 2016, at 2:33 PM, Christopher Ferris <cferris at google.com> wrote:
> It appears, that under certain circumstances, the arenas_cache can be leaked when shutting down a thread.
> Specifically, in tsd.c (function tsd_cleanup), this code:
> #define O(n, t) \
> #undef O
> tsd->state = tsd_state_purgatory;
> The cleanup part can wind up creating an arenas_cache, then the tsd_set clears the arenas_cache pointer, and the memory is leaked away.
> I added this call:
> After the undef and before the tsd->state, and the leak disappears. I'm not sure if there is a better way to fix this though.
More information about the jemalloc-discuss