Release free memory with jemalloc

Jason Evans jasone at canonware.com
Fri Oct 16 06:47:23 PDT 2015


On Oct 16, 2015, at 4:16 AM, Tigran Sarukhanyan <sstigran at hotmail.com> wrote:
> I am trying to use jemalloc for our application. The application has such engines that use lots of memory and it is considerable to free memory back to the operating system for reuse. We use Google's MallocExtension::ReleaseFreeMemory implemented in tcmalloc after finishing such engines.
> 
> Is there a way to do this with jemalloc?

Yes, you can do a similar thing with jemalloc.  Take a look at the manual page, in particular:

	http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#arena.i.purge
	http://www.canonware.com/download/jemalloc/jemalloc-latest/doc/jemalloc.html#thread.tcache.flush

There are numerous other approaches that may be more appropriate for your application, so it's worth skimming the entire manual page for ideas.

Jason


More information about the jemalloc-discuss mailing list