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

Unified Diff: content/common/discardable_shared_memory_heap.cc

Issue 1374213002: [tracing] Display the locked size of discardable memory segment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 ccf2729c557f660e3b675def1393449be60564dd..ea614b40d326083d246d1772dbc40fd1807f4323 100644
--- a/content/common/discardable_shared_memory_heap.cc
+++ b/content/common/discardable_shared_memory_heap.cc
@@ -396,6 +396,18 @@ void DiscardableSharedMemoryHeap::OnMemoryDump(
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
static_cast<uint64_t>(allocated_objects_size_in_bytes));
+ // Total size of discardable memory segments locked by the clients.
+ const size_t locked_size = shared_memory->LockedSize();
+ obj_dump->AddScalar("client_locked_size",
reveman 2015/09/29 12:29:10 I think it will be enough to dump the exact locked
ssid 2015/09/29 16:03:55 Sounds good.
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ locked_size);
+
+ // Size of the discardable segment actually locked by the platform
+ // independent lock.
+ obj_dump->AddScalar("actual_locked_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ locked_size ? size : 0u);
+
// Emit an ownership edge towards a global allocator dump node. This allows
// to avoid double-counting segments when both browser and child process emit
// them. In the special case of single-process-mode, this will be the only

Powered by Google App Engine
This is Rietveld 408576698