Supporting 'bookkeeping' and 'bin_unused' memory reporters in Gecko
ggp at mozilla.com
Thu Oct 30 15:45:47 PDT 2014
Our memory reporting tools in Gecko rely on two statistics that don't seem straightforward
to obtain on latest jemalloc: "bookkeeping" and "bin_unused".
"bookkeeping" is defined as "Committed bytes which the heap allocator uses for internal data
structures." , and is currently calculated in our mozjemalloc as the total memory used by
all arena and chunk headers. As the comment in  suggests, it looks like this could be
computed by adding up all base allocations in jemalloc3.
"bin_unused" is defined as "Bytes reserved for bins of fixed-size allocations which do not
correspond to an active allocation." , and is computed in mozjemalloc by adding up the product
of each bin's number of free regions by their size.
I don't see a suitable mallctl call that would give us the information we need to compute these
metrics. Would it be possible to expose that information as statistics?
The associated Gecko bug for this is https://bugzilla.mozilla.org/show_bug.cgi?id=899126 .
More information about the jemalloc-discuss