Supporting 'bookkeeping' and 'bin_unused' memory reporters in Gecko

Guilherme Goncalves ggp at
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." [1], and is currently calculated in our mozjemalloc as the total memory used by
all arena and chunk headers. As the comment in [2] 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." [3], 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 .




More information about the jemalloc-discuss mailing list