diff options
author | ruuda <ruuda@google.com> | 2015-11-06 03:58:33 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-06 11:59:26 +0000 |
commit | 97b80e625f392ae29d44cad4ff6e6f3d38c48dd0 (patch) | |
tree | 31ab56e99c7445a036ba0a42d69b91eaea584100 /content | |
parent | be13d7fe5850aa29307bb9c70cffb1ceb0db45a8 (diff) | |
download | chromium_src-97b80e625f392ae29d44cad4ff6e6f3d38c48dd0.zip chromium_src-97b80e625f392ae29d44cad4ff6e6f3d38c48dd0.tar.gz chromium_src-97b80e625f392ae29d44cad4ff6e6f3d38c48dd0.tar.bz2 |
[Tracing] Estimate memory overhead of AllocationRegister
This adds size estimation features to |AllocationRegister|. It will
report a large resident size, but a very small allocated size, because
the allocation register does not use malloc to allocate.
The PartitionAlloc dumper now estimates its heap profiling memory
overhead.
BUG=548614
Review URL: https://codereview.chromium.org/1428753008
Cr-Commit-Position: refs/heads/master@{#358308}
Diffstat (limited to 'content')
-rw-r--r-- | content/child/web_memory_dump_provider_adapter.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/content/child/web_memory_dump_provider_adapter.cc b/content/child/web_memory_dump_provider_adapter.cc index 6b33aac..8666fd09 100644 --- a/content/child/web_memory_dump_provider_adapter.cc +++ b/content/child/web_memory_dump_provider_adapter.cc @@ -10,6 +10,7 @@ #include "base/trace_event/memory_profiler_heap_dump_writer.h" #include "base/trace_event/process_memory_dump.h" #include "base/trace_event/trace_event_argument.h" +#include "base/trace_event/trace_event_memory_overhead.h" #include "content/child/web_process_memory_dump_impl.h" #include "third_party/WebKit/public/platform/WebMemoryDumpProvider.h" @@ -74,14 +75,18 @@ bool WebMemoryDumpProviderAdapter::OnMemoryDump( web_memory_dump_provider_->supportsHeapProfiling() && g_heap_profiling_enabled) { HeapDumpWriter writer(pmd->session_state()->stack_frame_deduplicator()); + TraceEventMemoryOverhead overhead; { AutoLock lock(g_allocation_register_lock.Get()); for (const auto& alloc_size : *g_allocation_register) writer.InsertAllocation(alloc_size.context, alloc_size.size); + + g_allocation_register->EstimateTraceMemoryOverhead(&overhead); } pmd->AddHeapDump("partition_alloc", writer.WriteHeapDump()); + overhead.DumpInto("tracing/heap_profiler", pmd); } return web_memory_dump_provider_->onMemoryDump(level, &web_pmd_impl); |