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

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

Issue 1149673002: Adding blink gc memory dump infrastructure for thread specific dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Making changes for forced GC. Created 5 years, 7 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: Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
diff --git a/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp b/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
index 7db5047e1e7f5b82101318b4ab4bb99047ba2e7c..6d696b3f9652ece104349059c92a4e7f46e85062 100644
--- a/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
+++ b/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
@@ -6,6 +6,7 @@
#include "Source/platform/heap/BlinkGCMemoryDumpProvider.h"
#include "platform/heap/Handle.h"
+#include "public/platform/Platform.h"
#include "public/platform/WebMemoryAllocatorDump.h"
#include "public/platform/WebProcessMemoryDump.h"
#include "wtf/StdLibExtras.h"
@@ -18,21 +19,33 @@ BlinkGCMemoryDumpProvider* BlinkGCMemoryDumpProvider::instance()
return &instance;
}
+BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider()
+{
+}
+
bool BlinkGCMemoryDumpProvider::onMemoryDump(blink::WebProcessMemoryDump* memoryDump)
{
+ m_currentProcessMemoryDump->clear();
+ Heap::collectGarbage(ThreadState::NoHeapPointersOnStack, ThreadState::TakeSnapshot, Heap::ForcedGC);
Primiano Tucci (use gerrit) 2015/05/27 14:19:30 Can you add a comment before this line clarifing t
ssid 2015/05/27 14:39:33 Added below.
+
WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDump("blink_gc");
allocatorDump->AddScalar("inner_size", "bytes", Heap::allocatedObjectSize());
allocatorDump->AddScalar("outer_size", "bytes", Heap::allocatedSpace());
allocatorDump->AddScalar("estimated_live_object_size", "bytes", Heap::estimatedLiveObjectSize());
+
+ memoryDump->takeAllDumpsFrom(m_currentProcessMemoryDump.get());
Primiano Tucci (use gerrit) 2015/05/27 14:19:30 Or alternatively you can comment here saying: merg
ssid 2015/05/27 14:39:33 Done.
return true;
}
-BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider()
+WebMemoryAllocatorDump* BlinkGCMemoryDumpProvider::createMemoryAllocatorDumpForCurrentGC(const String& absoluteName)
{
+ return m_currentProcessMemoryDump->createMemoryAllocatorDump(absoluteName);
}
-BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider()
+BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider()
{
+ m_currentProcessMemoryDump = adoptPtr(Platform::current()->createProcessMemoryDump());
Primiano Tucci (use gerrit) 2015/05/27 14:19:30 Can you do this in the ctor initializer list? Othe
ssid 2015/05/27 14:39:33 Done.
+ ASSERT(m_currentProcessMemoryDump);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698