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

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

Issue 1156863002: Oilpan: Tweak a GC threshold to consider memory increase in PartitionAlloc Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 | 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 d9618393402e09b50ac8cde15375e2335c00c7d9..a1b13d22a26c9b03b4ee149e93ab34ef7d10300e 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -539,10 +539,9 @@ bool ThreadState::shouldScheduleIdleGC()
// Heap::markedObjectSize() may be underestimated if any thread has not
// finished completeSweep().
size_t currentObjectSize = allocatedObjectSize + Heap::markedObjectSize() + WTF::Partitions::totalSizeOfCommittedPages();
- // Schedule an idle GC if Oilpan has allocated more than 1 MB since
- // the last GC and the current memory usage is >50% larger than
- // the estimated live memory usage.
- return allocatedObjectSize >= 1024 * 1024 && currentObjectSize > estimatedLiveObjectSize * 3 / 2;
+ // Schedule an idle GC if Oilpan has allocated more than 1 MB and the
+ // current memory usage is >50% larger than the estimated live memory usage.
+ return Heap::allocatedSpace() >= 1024 * 1024 && currentObjectSize > estimatedLiveObjectSize * 3 / 2;
#else
return false;
#endif
@@ -565,10 +564,9 @@ bool ThreadState::shouldSchedulePreciseGC()
// Heap::markedObjectSize() may be underestimated if any thread has not
// finished completeSweep().
size_t currentObjectSize = allocatedObjectSize + Heap::markedObjectSize() + WTF::Partitions::totalSizeOfCommittedPages();
- // Schedule a precise GC if Oilpan has allocated more than 1 MB since
- // the last GC and the current memory usage is >50% larger than
- // the estimated live memory usage.
- return allocatedObjectSize >= 1024 * 1024 && currentObjectSize > estimatedLiveObjectSize * 3 / 2;
+ // Schedule a precise GC if Oilpan has allocated more than 1 MB and the
+ // current memory usage is >50% larger than the estimated live memory usage.
+ return Heap::allocatedSpace() >= 1024 * 1024 && currentObjectSize > estimatedLiveObjectSize * 3 / 2;
#endif
}
@@ -592,11 +590,11 @@ bool ThreadState::shouldForceConservativeGC()
// aggressively. This is a safe guard to avoid OOM.
return currentObjectSize > estimatedLiveObjectSize * 3 / 2;
sof 2015/06/09 15:49:56 If size_t is 4 bytes wide (win32), the computation
}
- // Schedule a conservative GC if Oilpan has allocated more than 32 MB since
- // the last GC and the current memory usage is >400% larger than
- // the estimated live memory usage.
+ // Schedule a conservative GC if Oilpan has allocated more than 32 MB and
+ // the current memory usage is >400% larger than the estimated live memory
+ // usage.
// TODO(haraken): 400% is too large. Lower the heap growing factor.
- return allocatedObjectSize >= 32 * 1024 * 1024 && currentObjectSize > 5 * estimatedLiveObjectSize;
+ return Heap::allocatedSpace() >= 32 * 1024 * 1024 && currentObjectSize > 5 * estimatedLiveObjectSize;
}
void ThreadState::scheduleGCIfNeeded()
« 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