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

Side by Side Diff: third_party/WebKit/Source/platform/heap/BlinkGCMemoryDumpProvider.cpp

Issue 1477023003: Refactor the Heap into ThreadHeap to prepare for per thread heaps Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactored Created 4 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "platform/heap/BlinkGCMemoryDumpProvider.h" 5 #include "platform/heap/BlinkGCMemoryDumpProvider.h"
6 6
7 #include "platform/heap/Handle.h" 7 #include "platform/heap/Handle.h"
8 #include "public/platform/Platform.h" 8 #include "public/platform/Platform.h"
9 #include "public/platform/WebMemoryAllocatorDump.h" 9 #include "public/platform/WebMemoryAllocatorDump.h"
10 #include "public/platform/WebProcessMemoryDump.h" 10 #include "public/platform/WebProcessMemoryDump.h"
11 #include "wtf/StdLibExtras.h" 11 #include "wtf/StdLibExtras.h"
12 #include "wtf/Threading.h" 12 #include "wtf/Threading.h"
13 13
14 namespace blink { 14 namespace blink {
15 namespace { 15 namespace {
16 16
17 void dumpMemoryTotals(blink::WebProcessMemoryDump* memoryDump) 17 void dumpMemoryTotals(blink::WebProcessMemoryDump* memoryDump)
18 { 18 {
19 String dumpName = String::format("blink_gc"); 19 String dumpName = String::format("blink_gc");
20 WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDum p(dumpName); 20 WebMemoryAllocatorDump* allocatorDump = memoryDump->createMemoryAllocatorDum p(dumpName);
21 allocatorDump->addScalar("size", "bytes", Heap::allocatedSpace()); 21 allocatorDump->addScalar("size", "bytes", ThreadState::current()->gcGroup()- >heapStats().allocatedSpace());
haraken 2016/01/28 15:52:48 I think allocatedSpace should be a member of Heap,
keishi 2016/02/29 06:02:32 Used Heap::totalAllocatedSpace
22 22
23 dumpName.append("/allocated_objects"); 23 dumpName.append("/allocated_objects");
24 WebMemoryAllocatorDump* objectsDump = memoryDump->createMemoryAllocatorDump( dumpName); 24 WebMemoryAllocatorDump* objectsDump = memoryDump->createMemoryAllocatorDump( dumpName);
25 25
26 // Heap::markedObjectSize() can be underestimated if we're still in the 26 // Heap::markedObjectSize() can be underestimated if we're still in the
27 // process of lazy sweeping. 27 // process of lazy sweeping.
28 objectsDump->addScalar("size", "bytes", Heap::allocatedObjectSize() + Heap:: markedObjectSize()); 28 objectsDump->addScalar("size", "bytes", Heap::totalAllocatedObjectSize() + H eap::totalMarkedObjectSize());
29 } 29 }
30 30
31 } // namespace 31 } // namespace
32 32
33 BlinkGCMemoryDumpProvider* BlinkGCMemoryDumpProvider::instance() 33 BlinkGCMemoryDumpProvider* BlinkGCMemoryDumpProvider::instance()
34 { 34 {
35 DEFINE_STATIC_LOCAL(BlinkGCMemoryDumpProvider, instance, ()); 35 DEFINE_STATIC_LOCAL(BlinkGCMemoryDumpProvider, instance, ());
36 return &instance; 36 return &instance;
37 } 37 }
38 38
(...skipping 25 matching lines...) Expand all
64 { 64 {
65 m_currentProcessMemoryDump->clear(); 65 m_currentProcessMemoryDump->clear();
66 } 66 }
67 67
68 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider() 68 BlinkGCMemoryDumpProvider::BlinkGCMemoryDumpProvider()
69 : m_currentProcessMemoryDump(adoptPtr(Platform::current()->createProcessMemo ryDump())) 69 : m_currentProcessMemoryDump(adoptPtr(Platform::current()->createProcessMemo ryDump()))
70 { 70 {
71 } 71 }
72 72
73 } // namespace blink 73 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698