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

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

Issue 1201773004: Oilpan: Trace Heap memory statistics more often. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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 | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.cpp
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
index 71ffd4fe938cf55e8bbaf6f19b47d8f5c285fae0..6a47174f77250b02928bfd10e5a7787ae0289799 100644
--- a/Source/platform/heap/Heap.cpp
+++ b/Source/platform/heap/Heap.cpp
@@ -445,6 +445,9 @@ Address BaseHeap::lazySweep(size_t allocationSize, size_t gcInfoIndex)
if (threadState()->isMainThread())
ScriptForbiddenScope::exit();
+
+ Heap::reportMemoryUsageForTracing();
+
return result;
}
@@ -481,11 +484,13 @@ bool BaseHeap::lazySweepWithDeadline(double deadlineSeconds)
if (pageCount % deadlineCheckInterval == 0) {
if (deadlineSeconds <= Platform::current()->monotonicallyIncreasingTime()) {
// Deadline has come.
+ Heap::reportMemoryUsageForTracing();
return !m_firstUnsweptPage;
}
}
pageCount++;
}
+ Heap::reportMemoryUsageForTracing();
return true;
}
@@ -498,6 +503,8 @@ void BaseHeap::completeSweep()
while (m_firstUnsweptPage) {
sweepUnsweptPage();
}
+
+ Heap::reportMemoryUsageForTracing();
haraken 2015/06/22 04:28:51 I think it's better to put Heap::reportMemoryUsage
Yuta Kitamura 2015/06/22 08:31:52 Correct me if I'm wrong, but I think no ThreadStat
}
NormalPageHeap::NormalPageHeap(ThreadState* state, int index)
@@ -2190,6 +2197,18 @@ void Heap::reportMemoryUsageHistogram()
}
}
+#if ENABLE(GC_PROFILING)
+void Heap::reportMemoryUsageForTracing()
+{
+ // These values are divided by 1024 to avoid overflow in practical cases (TRACE_COUNTER values are 32-bit ints).
+ // They are capped to INT_MAX just in case.
+ TRACE_COUNTER1("blink_gc", "Heap::estimatedLiveObjectSizeKB", std::min(Heap::estimatedLiveObjectSize() / 1024, static_cast<size_t>(INT_MAX)));
+ TRACE_COUNTER1("blink_gc", "Heap::allocatedObjectSizeKB", std::min(Heap::allocatedObjectSize() / 1024, static_cast<size_t>(INT_MAX)));
+ TRACE_COUNTER1("blink_gc", "Heap::markedObjectSizeKB", std::min(Heap::markedObjectSize() / 1024, static_cast<size_t>(INT_MAX)));
+ TRACE_COUNTER1("blink_gc", "Partitions::totalSizeOfCommittedPagesKB", std::min(WTF::Partitions::totalSizeOfCommittedPages() / 1024, static_cast<size_t>(INT_MAX)));
+}
+#endif
+
size_t Heap::objectPayloadSizeForTesting()
{
size_t objectPayloadSize = 0;
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698