Index: Source/platform/heap/Heap.cpp |
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp |
index c938b3a3ffe05e998fc64b37b3048150329650cc..26a92bbcaea0568887fbd99a5f0c7e5d9bb7eaa9 100644 |
--- a/Source/platform/heap/Heap.cpp |
+++ b/Source/platform/heap/Heap.cpp |
@@ -41,6 +41,8 @@ |
#include "platform/heap/SafePoint.h" |
#include "platform/heap/ThreadState.h" |
#include "public/platform/Platform.h" |
+#include "public/platform/WebMemoryAllocatorDump.h" |
+#include "public/platform/WebProcessMemoryDump.h" |
#include "wtf/Assertions.h" |
#include "wtf/ContainerAnnotations.h" |
#include "wtf/LeakAnnotations.h" |
@@ -213,6 +215,16 @@ void BaseHeap::cleanupPages() |
m_firstPage = nullptr; |
} |
+void BaseHeap::snapshotMemory(WebProcessMemoryDump* memoryDump, const char* heapName) |
Primiano Tucci (use gerrit)
2015/05/21 09:56:33
I wonder if we should start calling our functions
ssid
2015/05/21 11:38:55
Done.
|
+{ |
+ String allocatorName = String::format("blink_gc/thread_%p/heaps/%s", threadState(), heapName); |
Primiano Tucci (use gerrit)
2015/05/21 09:56:33
s/allocatorName/dumpName/
Primiano Tucci (use gerrit)
2015/05/21 09:56:33
for the thread name, it would be great if:
1) for
ssid
2015/05/21 11:38:55
done.
ssid
2015/05/21 11:38:55
Done.
|
+ WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDump(allocatorName); |
+ |
+ size_t pageCount = 0; |
+ for (BasePage* page = m_firstPage; page; page = page->next(), ++pageCount) { } |
+ allocatorDump->AddScalar("page_count", "objects", pageCount); |
Primiano Tucci (use gerrit)
2015/05/21 09:56:33
we have to find a slightly different name here (id
ssid
2015/05/21 16:55:28
Done.
|
+} |
Primiano Tucci (use gerrit)
2015/05/21 09:56:33
some questions here (I guess will be mostly for qu
ssid
2015/05/21 11:38:55
Empty pages are still taking space in the heap. Th
|
+ |
#if ENABLE(ASSERT) || ENABLE(GC_PROFILING) |
BasePage* BaseHeap::findPageFromAddress(Address address) |
{ |