A bit more explanation on how to use jemalloc statistics

1.5k Views Asked by At

Besides being an apparently good memory allocation library jemalloc also offers built-in allocation statistics. However this requires some understanding on jemalloc's internal data structures. So when I call malloc_stats_print(NULL, NULL, NULL), I get quite some output similar to what the jemalloc people show on their github wiki page.

So my own use case for using these statistics is to see which type of allocations seems to be net growing over time in a problematic way. Say that I have some type of object of size S for which I think this growth is happening. How can I check that using periodic calls to malloc_stats_print?

Furthermore what is the difference between nmalloc and nrequests and which other metrics of the full output of this call should I care about in search for unaccounted memory growth.

0

There are 0 best solutions below