How do you completely shut down and re-initialize jemalloc at runtime?

Jason Evans jasone at canonware.com
Tue May 20 12:30:09 PDT 2014


On May 8, 2014, at 10:32 PM, Paul Pedriana <ppedriana at gmail.com> wrote:
> In the middle of running my app I want to shut down jemalloc and restore it to its state at application startup and be able to then use it as if new. In shutting it down I would of course make sure that there are no outstanding memory in use from it. Is this possible? If so how would I do it?

This isn’t possible, partly because jemalloc automatically initializes various internal data structures that aren’t designed to be reset.  The other big issue is that jemalloc (intentionally) doesn’t maintain enough information to find all extant allocations, so there’s no way to discard all of them.

Jason


More information about the jemalloc-discuss mailing list