Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1600)

Unified Diff: content/common/discardable_shared_memory_heap.cc

Issue 1375963007: [tracing] Display the resident size of the discardable memory segments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lock_discardable
Patch Set: Fix mac. Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/discardable_shared_memory_heap.cc
diff --git a/content/common/discardable_shared_memory_heap.cc b/content/common/discardable_shared_memory_heap.cc
index b641c0697442579e09a4b2801beca411f05540e3..c9c47d2883e6239a16b042175cd7a4bad86d8d93 100644
--- a/content/common/discardable_shared_memory_heap.cc
+++ b/content/common/discardable_shared_memory_heap.cc
@@ -395,6 +395,15 @@ void DiscardableSharedMemoryHeap::OnMemoryDump(
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
size);
+ ssize_t resident_size =
+ base::trace_event::ProcessMemoryDump::CountResidentBytes(
+ shared_memory->memory(), shared_memory->mapped_size());
+ if (resident_size >= 0) {
+ segment_dump->AddScalar("resident_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64>(resident_size));
+ }
+
base::trace_event::MemoryAllocatorDump* obj_dump =
pmd->CreateAllocatorDump(segment_dump_name + "/allocated_objects");
obj_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,

Powered by Google App Engine
This is Rietveld 408576698