diff options
| author | Jason Evans <jasone@canonware.com> | 2016-05-28 17:29:03 -0700 |
|---|---|---|
| committer | Jason Evans <jasone@canonware.com> | 2016-06-05 20:42:23 -0700 |
| commit | d28e5a6696fd59a45c156b5c4dc183bb9ed21596 (patch) | |
| tree | 046b3a745b7b711224f404ca2b630c34cf378d6f /include/jemalloc | |
| parent | ed2c2427a7684bc8f41da54319c5dff00e177f76 (diff) | |
| download | platform_external_jemalloc_new-d28e5a6696fd59a45c156b5c4dc183bb9ed21596.tar.gz platform_external_jemalloc_new-d28e5a6696fd59a45c156b5c4dc183bb9ed21596.tar.bz2 platform_external_jemalloc_new-d28e5a6696fd59a45c156b5c4dc183bb9ed21596.zip | |
Improve interval-based profile dump triggering.
When an allocation is large enough to trigger multiple dumps, use
modular math rather than subtraction to reset the interval counter.
Prior to this change, it was possible for a single allocation to cause
many subsequent allocations to all trigger profile dumps.
When updating usable size for a sampled object, try to cancel out
the difference between LARGE_MINCLASS and usable size from the interval
counter.
Diffstat (limited to 'include/jemalloc')
| -rw-r--r-- | include/jemalloc/internal/arena.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/jemalloc/internal/arena.h b/include/jemalloc/internal/arena.h index bf16e8e9..b0c4b5f3 100644 --- a/include/jemalloc/internal/arena.h +++ b/include/jemalloc/internal/arena.h @@ -984,7 +984,7 @@ arena_prof_accum_impl(arena_t *arena, uint64_t accumbytes) arena->prof_accumbytes += accumbytes; if (arena->prof_accumbytes >= prof_interval) { - arena->prof_accumbytes -= prof_interval; + arena->prof_accumbytes %= prof_interval; return (true); } return (false); |
