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()); |