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

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

Issue 1315603004: Oilpan: Report memory usage at each safe point (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.cpp
diff --git a/Source/platform/heap/ThreadState.cpp b/Source/platform/heap/ThreadState.cpp
index a6f33018f482969fc7ba57ef9a9f26bd31ccec49..cd9b8ece825968d398643ef089d43ba0138c1954 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -676,6 +676,8 @@ bool ThreadState::shouldForceConservativeGC()
void ThreadState::scheduleV8FollowupGCIfNeeded()
{
ASSERT(checkThread());
+ Heap::reportMemoryUsageForTracing();
+
if (isGCForbidden())
return;
@@ -683,7 +685,6 @@ void ThreadState::scheduleV8FollowupGCIfNeeded()
return;
ASSERT(!sweepForbidden());
- Heap::reportMemoryUsageForTracing();
if (shouldScheduleV8FollowupGC())
schedulePreciseGC();
}
@@ -691,6 +692,8 @@ void ThreadState::scheduleV8FollowupGCIfNeeded()
void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio)
{
ASSERT(checkThread());
+ Heap::reportMemoryUsageForTracing();
+
if (isGCForbidden())
return;
@@ -701,7 +704,6 @@ void ThreadState::schedulePageNavigationGCIfNeeded(float estimatedRemovalRatio)
ASSERT(!isSweepingInProgress());
ASSERT(!sweepForbidden());
- Heap::reportMemoryUsageForTracing();
if (shouldSchedulePageNavigationGC(estimatedRemovalRatio))
schedulePageNavigationGC();
}
@@ -716,6 +718,8 @@ void ThreadState::schedulePageNavigationGC()
void ThreadState::scheduleGCIfNeeded()
{
ASSERT(checkThread());
+ Heap::reportMemoryUsageForTracing();
+
if (isGCForbidden())
return;
@@ -725,8 +729,6 @@ void ThreadState::scheduleGCIfNeeded()
return;
ASSERT(!sweepForbidden());
- Heap::reportMemoryUsageForTracing();
-
if (shouldForceMemoryPressureGC()) {
Heap::collectGarbage(HeapPointersOnStack, GCWithoutSweep, Heap::ConservativeGC);
return;
@@ -1230,6 +1232,8 @@ void ThreadState::resumeThreads()
void ThreadState::safePoint(StackState stackState)
{
ASSERT(checkThread());
+ Heap::reportMemoryUsageForTracing();
+
runScheduledGC(stackState);
ASSERT(!m_atSafePoint);
m_stackState = stackState;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698