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

Unified Diff: src/heap/memory-reducer.cc

Issue 1420283021: Temporarily revert to non-incremental GC in background tabs to see (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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: src/heap/memory-reducer.cc
diff --git a/src/heap/memory-reducer.cc b/src/heap/memory-reducer.cc
index 6b0e1f8fed0cfb6190b5794666481ae0a5649d54..9fadd08dca3d1e564a96753b4f537885ca829d93 100644
--- a/src/heap/memory-reducer.cc
+++ b/src/heap/memory-reducer.cc
@@ -73,7 +73,14 @@ void MemoryReducer::NotifyTimer(const Event& event) {
PrintIsolate(heap()->isolate(), "Memory reducer: started GC #%d\n",
state_.started_gcs);
}
- heap()->StartIdleIncrementalMarking();
+ if (heap()->ShouldOptimizeForMemoryUsage()) {
+ // TODO(ulan): Remove this once crbug.com/552305 is fixed.
+ // Do full GC if memory usage has higher priority than latency.
+ heap()->CollectAllGarbage(Heap::kReduceMemoryFootprintMask,
+ "memory reducer");
+ } else {
+ heap()->StartIdleIncrementalMarking();
+ }
} else if (state_.action == kWait) {
if (!heap()->incremental_marking()->IsStopped() &&
heap()->ShouldOptimizeForMemoryUsage()) {
« 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