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

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 986eea1f3c245bb8fe3c121900f53b3c242127bf..eb3522ec31ea45e75ed2a856b76448a9d2c3e47b 100644
--- a/Source/platform/heap/ThreadState.cpp
+++ b/Source/platform/heap/ThreadState.cpp
@@ -515,10 +515,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;
+ return Heap::allocatedSpace() >= 1024 * 1024 // Oilpan has allocated >1 MB.
+ && currentObjectSize >= 1024 * 1024 // Oilpan or/and PartitionAlloc have allocated >1 MB since the last GC.
sof 2015/05/25 21:37:51 If allocatedObjectSize >= 1024 * 1024, doesn't tha
haraken 2015/05/25 23:31:53 Yes. - allocatedObjectSize >= 1 MB implies curren
sof 2015/05/26 05:10:59 Oops, quite right - I didn't pick the suffixes apa
+ && currentObjectSize > estimatedLiveObjectSize * 3 / 2; // The current memory usage is >50% larger than the estimated live memory usage.
#else
return false;
#endif
@@ -541,10 +540,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;
+ return Heap::allocatedSpace() >= 1024 * 1024 // Oilpan has allocated >1 MB.
+ && currentObjectSize >= 1024 * 1024 // Oilpan or/and PartitionAlloc have allocated >1 MB since the last GC.
sof 2015/05/26 19:25:37 Is this really true? totalSizeOfCommittedPages() d
haraken 2015/05/27 00:39:00 You're right; this comment is wrong. It should be:
sof 2015/05/27 05:09:07 Not just the comment is wrong; this seems like cur
haraken 2015/05/27 05:50:03 There would be various opinions, but IMO this is a
+ && currentObjectSize > estimatedLiveObjectSize * 3 / 2; // The current memory usage is >50% larger than the estimated live memory usage.
#endif
}
@@ -568,11 +566,9 @@ bool ThreadState::shouldForceConservativeGC()
// aggressively. This is a safe guard to avoid OOM.
return currentObjectSize > estimatedLiveObjectSize * 3 / 2;
}
- // 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.
- // TODO(haraken): 400% is too large. Lower the heap growing factor.
- return allocatedObjectSize >= 32 * 1024 * 1024 && currentObjectSize > 5 * estimatedLiveObjectSize;
+ return Heap::allocatedSpace() >= 1024 * 1024 // Oilpan has allocated >1 MB.
+ && currentObjectSize >= 32 * 1024 * 1024 // Oilpan or/and PartitionAlloc have allocated >32 MB since the last GC.
+ && currentObjectSize > estimatedLiveObjectSize * 5; // The current memory usage is >400% larger than the estimated live memory usage. TODO(haraken): 400% is too large. Lower the heap growing factor.
}
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