summaryrefslogtreecommitdiffstats
path: root/base/trace_event/malloc_dump_provider.cc
diff options
context:
space:
mode:
authorprimiano <primiano@chromium.org>2015-06-17 04:58:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-17 11:58:45 +0000
commitdb8a28cf1603950a2dedda3329d01285a3e317cd (patch)
treed8bb81503c80e5c1f51a59992844f29dd4f79482 /base/trace_event/malloc_dump_provider.cc
parentd1c9f9fbe26992894355b68f0445e03c2061908f (diff)
downloadchromium_src-db8a28cf1603950a2dedda3329d01285a3e317cd.zip
chromium_src-db8a28cf1603950a2dedda3329d01285a3e317cd.tar.gz
chromium_src-db8a28cf1603950a2dedda3329d01285a3e317cd.tar.bz2
[tracing] Fix malloc accounting in memory-infra
Currently the malloc dump provider is reporting the total virtual size as official "size" (the one plotted in the tracks) and the allocated_objects as a child. This is not fully correct, as the heap is not always necessarily used and, more importantly, creates some funky behavior when discounting the trace overehad. This change moves the outer heap size to its own property, so that the actual |uordblocks| becomes the size plotted on the track. BUG=495628,467112 Review URL: https://codereview.chromium.org/1191893002 Cr-Commit-Position: refs/heads/master@{#334812}
Diffstat (limited to 'base/trace_event/malloc_dump_provider.cc')
-rw-r--r--base/trace_event/malloc_dump_provider.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
index 92d513f..3e593b0 100644
--- a/base/trace_event/malloc_dump_provider.cc
+++ b/base/trace_event/malloc_dump_provider.cc
@@ -32,13 +32,13 @@ bool MallocDumpProvider::OnMemoryDump(ProcessMemoryDump* pmd) {
struct mallinfo info = mallinfo();
DCHECK_GE(info.arena + info.hblkhd, info.uordblks);
- // When the system allocator is implemented by tcmalloc, the total physical
+ // When the system allocator is implemented by tcmalloc, the total heap
// size is given by |arena| and |hblkhd| is 0. In case of Android's jemalloc
// |arena| is 0 and the outer pages size is reported by |hblkhd|. In case of
// dlmalloc the total is given by |arena| + |hblkhd|.
// For more details see link: http://goo.gl/fMR8lF.
MemoryAllocatorDump* outer_dump = pmd->CreateAllocatorDump("malloc");
- outer_dump->AddScalar(MemoryAllocatorDump::kNameSize,
+ outer_dump->AddScalar("heap_virtual_size",
MemoryAllocatorDump::kUnitsBytes,
info.arena + info.hblkhd);