Description[Tracing] Introduce HeapDumpWriter helper class
The heap profiler in chrome://tracing keeps track of allocations in an
|AllocationRegister|. When a heap dump is requested, a summary of the
allocation register should be written to the trace log. (It is not
possible to dump every single allocation, some processes have peeks as
high as 400k outstanding allocations.) The |HeapDumpWriter| class
analyzes all allocations and writes a condensed heap dump to the trace
log.
At the moment the logic is very simple. All allocations are grouped by
backtrace, and the number of bytes allocated per backtrace is written.
In the future this will be extended with the ability to group by
different pieces of context. Furthermore, a smarter algorithm can be
introduced that writes as much information as possible given a fixed
budget of trace log space.
The heap dump writer is designed to be independent of the
|StackFrameDeduplicator|. There could be a deduplicator per dump
provider, or a global deduplicator. By taking it as an argument,
the dumper works either way.
BUG=524631
Committed: https://crrev.com/51d9e66be7968f1b8844f44effe066708a0536d6
Cr-Commit-Position: refs/heads/master@{#356282}
Patch Set 1 #Patch Set 2 : Mark Backtrace as BASE_EXPORT #Patch Set 3 : Work around VS2013 compiler bug #Patch Set 4 : Cast literal to ensure correct type inference + small cleanup #Patch Set 5 : Remove WriteStackFrames, DISALLOW_COPY_AND_ASSIGN #
Total comments: 31
Patch Set 6 : Address primiano comments #
Total comments: 20
Patch Set 7 : Renames for trace log format #Patch Set 8 : Address primiano comments #
Total comments: 8
Patch Set 9 : Address nits #Messages
Total messages: 18 (4 generated)
|