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

Unified Diff: Source/platform/heap/BlinkGCMemoryDumpProvider.cpp

Issue 1203493004: [tracing] Adding class-wise memory statistics to blink gc memory dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Disabling the classes dump, avoid double counting, and comments. Created 5 years, 6 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
« no previous file with comments | « no previous file | Source/platform/heap/GCInfo.h » ('j') | Source/platform/heap/ThreadState.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
diff --git a/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp b/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
index fcdcff1e611b4bbd405e37c3ae0c001af8a6fc44..46a9b496ed24e931437ae562b5f685ca56c7b6bc 100644
--- a/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
+++ b/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
@@ -28,11 +28,13 @@ bool BlinkGCMemoryDumpProvider::onMemoryDump(blink::WebProcessMemoryDump* memory
{
Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::TakeSnapshot, Heap::ForcedGC);
String dumpName = String::format("blink_gc/thread_%lu", static_cast<unsigned long>(WTF::currentThread()));
- WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDump(dumpName);
+ WebMemoryAllocatorDump* allocatorDump = m_currentProcessMemoryDump->getMemoryAllocatorDump(dumpName);
+ if (!allocatorDump)
+ allocatorDump = m_currentProcessMemoryDump->createMemoryAllocatorDump(dumpName);
allocatorDump->AddScalar("size", "bytes", Heap::allocatedSpace());
dumpName.append("/allocated_objects");
- WebMemoryAllocatorDump* objectsDump = memoryDump->createMemoryAllocatorDump(dumpName);
+ WebMemoryAllocatorDump* objectsDump = m_currentProcessMemoryDump->createMemoryAllocatorDump(dumpName);
objectsDump->AddScalar("size", "bytes", Heap::allocatedObjectSize() + Heap::markedObjectSize());
objectsDump->AddScalar("estimated_live_object_size", "bytes", Heap::estimatedLiveObjectSize());
« no previous file with comments | « no previous file | Source/platform/heap/GCInfo.h » ('j') | Source/platform/heap/ThreadState.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698