mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-08-24 16:13:38 +03:00
Added stats about number of bytes cached in tcache currently.
This commit is contained in:
parent
12ab4383e9
commit
58424e679d
4 changed files with 40 additions and 0 deletions
15
src/arena.c
15
src/arena.c
|
|
@ -1625,6 +1625,21 @@ arena_stats_merge(tsdn_t *tsdn, arena_t *arena, unsigned *nthreads,
|
|||
lstats[i].nrequests += arena->stats.lstats[i].nrequests;
|
||||
lstats[i].curlextents += arena->stats.lstats[i].curlextents;
|
||||
}
|
||||
|
||||
if (config_tcache) {
|
||||
tcache_bin_t *tbin;
|
||||
tcache_t *tcache;
|
||||
|
||||
/* tcache_bytes counts currently cached bytes. */
|
||||
astats->tcache_bytes = 0;
|
||||
ql_foreach(tcache, &arena->tcache_ql, link) {
|
||||
for (i = 0; i < nhbins; i++) {
|
||||
tbin = &tcache->tbins[i];
|
||||
astats->tcache_bytes += tbin->ncached *
|
||||
index2size(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
malloc_mutex_unlock(tsdn, &arena->lock);
|
||||
|
||||
for (i = 0; i < NBINS; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue