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:
Jason Evans
2016-05-28 17:29:03 -07:00
parent ed2c2427a7
commit d28e5a6696
2 changed files with 15 additions and 1 deletions

View File

@@ -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);