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

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

Issue 1263373002: Perform full GC in background idle notification. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Guard full gc 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: src/heap/memory-reducer.cc
diff --git a/src/heap/memory-reducer.cc b/src/heap/memory-reducer.cc
index 7063fc4b2eb5c549ad6c1ba26e350461a4c824da..df24df577dbc702f3eaf42ed83192ea2fb467331 100644
--- a/src/heap/memory-reducer.cc
+++ b/src/heap/memory-reducer.cc
@@ -95,13 +95,20 @@ void MemoryReducer::NotifyBackgroundIdleNotification(const Event& event) {
if (old_action == kWait && state_.action == kWait &&
old_started_gcs + 1 == state_.started_gcs) {
DCHECK(heap()->incremental_marking()->IsStopped());
- DCHECK(FLAG_incremental_marking);
- heap()->StartIdleIncrementalMarking();
- if (FLAG_trace_gc_verbose) {
- PrintIsolate(heap()->isolate(),
- "Memory reducer: started GC #%d"
- " (background idle)\n",
- state_.started_gcs);
+ // TODO(ulan): Replace it with incremental marking GC once
+ // chromium:490559 is fixed.
+ if (event.time_ms > state_.last_gc_time_ms + kLongDelayMs) {
+ heap()->CollectAllGarbage(Heap::kReduceMemoryFootprintMask,
+ "memory reducer background GC");
+ } else {
+ DCHECK(FLAG_incremental_marking);
+ heap()->StartIdleIncrementalMarking();
+ if (FLAG_trace_gc_verbose) {
+ PrintIsolate(heap()->isolate(),
+ "Memory reducer: started GC #%d"
+ " (background idle)\n",
+ state_.started_gcs);
+ }
}
}
}
« 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