Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 1fe546386ba8d8baa5c452f87a218a19a2111781..e97a5a17e6f30f138ec846254323ec966bf0b3a8 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -4533,14 +4533,15 @@ void Heap::MakeHeapIterable() { |
} |
-void Heap::IdleMarkCompact(const char* message) { |
+void Heap::IdleMarkCompact(bool reduce_memory, const char* message) { |
bool uncommit = false; |
if (gc_count_at_last_idle_gc_ == gc_count_) { |
// No GC since the last full GC, the mutator is probably not active. |
isolate_->compilation_cache()->Clear(); |
uncommit = true; |
} |
- CollectAllGarbage(kReduceMemoryFootprintMask, message); |
+ int flags = reduce_memory ? kReduceMemoryFootprintMask : kNoGCFlags; |
+ CollectAllGarbage(flags, message); |
gc_idle_time_handler_.NotifyIdleMarkCompact(); |
gc_count_at_last_idle_gc_ = gc_count_; |
if (uncommit) { |
@@ -4672,10 +4673,14 @@ bool Heap::IdleNotification(double deadline_in_seconds) { |
gc_idle_time_handler_.NotifyIdleMarkCompact(); |
gc_count_at_last_idle_gc_ = gc_count_; |
} else { |
- IdleMarkCompact("idle notification: finalize idle round"); |
+ IdleMarkCompact(false, "idle notification: finalize idle round"); |
} |
break; |
} |
+ case DO_FULL_GC_COMPACT: { |
+ IdleMarkCompact(true, "idle notification: reduce memory footprint"); |
+ break; |
+ } |
case DO_SCAVENGE: |
CollectGarbage(NEW_SPACE, "idle notification: scavenge"); |
break; |