84b6a43b0c
Requested by: mi
36 lines
1.3 KiB
Text
36 lines
1.3 KiB
Text
changeset: 258513:ffbd5f5f46f1
|
|
user: Guilherme Goncalves <guilherme.p.gonc@gmail.com>
|
|
date: Thu Aug 20 10:05:29 2015 +0900
|
|
summary: Bug 1125514 - Use jemalloc's metadata statistics to compute bookkeeping. r=glandium
|
|
|
|
--- memory/build/mozjemalloc_compat.c~
|
|
+++ memory/build/mozjemalloc_compat.c
|
|
@@ -136,6 +136,7 @@ jemalloc_stats_impl(jemalloc_stats_t *st
|
|
{
|
|
unsigned narenas;
|
|
size_t active, allocated, mapped, page, pdirty;
|
|
+ size_t meta, ameta;
|
|
size_t lg_chunk;
|
|
|
|
// Refresh jemalloc's stats by updating its epoch, see ctl_refresh in
|
|
@@ -149,17 +150,19 @@ jemalloc_stats_impl(jemalloc_stats_t *st
|
|
CTL_GET("stats.active", active);
|
|
CTL_GET("stats.allocated", allocated);
|
|
CTL_GET("stats.mapped", mapped);
|
|
+ CTL_GET("stats.metadata", meta);
|
|
CTL_GET("opt.lg_chunk", lg_chunk);
|
|
- CTL_GET("stats.bookkeeping", stats->bookkeeping);
|
|
|
|
/* get the summation for all arenas, i == narenas */
|
|
CTL_I_GET("stats.arenas.0.pdirty", pdirty, narenas);
|
|
+ CTL_I_GET("stats.arenas.0.metadata.allocated", ameta, narenas);
|
|
|
|
stats->chunksize = 1 << lg_chunk;
|
|
stats->mapped = mapped;
|
|
stats->allocated = allocated;
|
|
stats->waste = active - allocated;
|
|
stats->page_cache = pdirty * page;
|
|
+ stats->bookkeeping = meta - ameta;
|
|
stats->bin_unused = compute_bin_unused(narenas);
|
|
stats->waste -= stats->bin_unused;
|
|
}
|