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()) { |