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

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: Fixing nits. 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
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | Source/platform/heap/Heap.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 7db5047e1e7f5b82101318b4ab4bb99047ba2e7c..e3db8dbe9181c954453ea13c5d5ad2f8431c300f 100644
--- a/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
+++ b/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp
@@ -18,12 +18,22 @@ BlinkGCMemoryDumpProvider* BlinkGCMemoryDumpProvider::instance()
return &instance;
}
-bool BlinkGCMemoryDumpProvider::onMemoryDump(blink::WebProcessMemoryDump* memoryDump)
+BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider()
{
+}
+
+bool BlinkGCMemoryDumpProvider::onMemoryDump(WebProcessMemoryDump* memoryDump)
+{
+ // The current heap statistics are added to the memory dump.
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());
+
+ // If available, the last GC memory statistics are added.
+ if (Heap::getLastProcessMemoryDump())
+ memoryDump->takeAllDumpsFrom(Heap::getLastProcessMemoryDump());
Primiano Tucci (use gerrit) 2015/05/22 15:50:21 Ok here you need the TODO pointing to crbug.com/49
ssid 2015/05/22 16:05:16 But we are dumping some overall numbers even if th
+
return true;
}
@@ -31,8 +41,4 @@ BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider()
{
}
-BlinkGCMemoryDumpProvider::~BlinkGCMemoryDumpProvider()
Primiano Tucci (use gerrit) 2015/05/22 15:50:21 Is this intended? I think you accidentally removed
ssid 2015/05/22 16:05:16 It is moved up to maintain the function order in h
-{
-}
-
} // namespace blink
« no previous file with comments | « no previous file | Source/platform/heap/Heap.h » ('j') | Source/platform/heap/Heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698