Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 322a9067437217653739f95a68a8a0d3046ad3dc..e1f28bf3cf83759819600303fe0b1e59a9203945 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -4992,8 +4992,10 @@ void Heap::AdvanceIdleIncrementalMarking(intptr_t step_size) { |
bool Heap::IdleNotification(int hint) { |
const int kMaxHint = 1000; |
- intptr_t size_factor = Min(Max(hint, 30), kMaxHint) / 10; |
- // The size factor is in range [3..100]. |
+ intptr_t size_factor = Min(Max(hint, 20), kMaxHint) / 4; |
+ // The size factor is in range [5..250]. The numbers here are chosen from |
+ // experiments. If you changes them, make sure to test with |
+ // chrome/performance_ui_tests --gtest_filter="GeneralMixMemoryTest.* |
intptr_t step_size = size_factor * IncrementalMarking::kAllocatedThreshold; |
if (contexts_disposed_ > 0) { |
@@ -5017,11 +5019,14 @@ bool Heap::IdleNotification(int hint) { |
// Take into account that we might have decided to delay full collection |
// because incremental marking is in progress. |
ASSERT((contexts_disposed_ == 0) || !incremental_marking()->IsStopped()); |
+ // After context disposal there is likely a lot of garbage remaining, reset |
+ // the idle notification counters in order to trigger more incremental GCs |
+ // on subsequent idle notifications. |
+ StartIdleRound(); |
return false; |
} |
- if (hint >= kMaxHint || !FLAG_incremental_marking || |
- FLAG_expose_gc || Serializer::enabled()) { |
+ if (!FLAG_incremental_marking || FLAG_expose_gc || Serializer::enabled()) { |
return IdleGlobalGC(); |
} |
@@ -5060,10 +5065,6 @@ bool Heap::IdleNotification(int hint) { |
} |
if (incremental_marking()->IsStopped()) { |
- if (!WorthStartingGCWhenIdle()) { |
- FinishIdleRound(); |
- return true; |
- } |
incremental_marking()->Start(); |
} |