mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-26 14:56:23 +03:00
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.
This commit is contained in:
parent
ed2c2427a7
commit
d28e5a6696
2 changed files with 15 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue