Index: src/heap/gc-idle-time-handler.h |
diff --git a/src/heap/gc-idle-time-handler.h b/src/heap/gc-idle-time-handler.h |
index e76178b7e676b547dcddf4d4b0e5b0d83f23cde4..137621f78995b7ec48ab724df443168b8cf2f00b 100644 |
--- a/src/heap/gc-idle-time-handler.h |
+++ b/src/heap/gc-idle-time-handler.h |
@@ -151,8 +151,9 @@ class GCIdleTimeHandler { |
// the kDone mode. |
static const int kMaxIdleMarkCompacts = 3; |
- // The number of mutator GCs before transitioning to the kReduceLatency mode. |
- static const int kGCsBeforeMutatorIsActive = 7; |
+ // The number of mutator MarkCompact GCs before transitioning to the |
+ // kReduceLatency mode. |
+ static const int kMarkCompactsBeforeMutatorIsActive = 1; |
// Mutator is considered idle if |
// 1) there is an idle notification with time >= kLargeLongIdleTime, |
@@ -161,8 +162,11 @@ class GCIdleTimeHandler { |
// with time >= kMinLongIdleTime and without any mutator GC in between. |
static const int kMinLongIdleTime = kMaxFrameRenderingIdleTime + 1; |
static const int kLargeLongIdleTime = 900; |
- static const int kLongIdleNotificationsBeforeMutatorIsIdle = 600; |
- |
+ static const int kLongIdleNotificationsBeforeMutatorIsIdle = 50; |
+ // Number of times we will return a Nothing action in the current mode |
+ // despite having idle time available before we returning a Done action to |
+ // ensure we don't keep scheduling idle tasks and making no progress. |
+ static const int kMaxNoProgressIdleTimesPerMode = 10; |
class HeapState { |
public: |
@@ -189,6 +193,7 @@ class GCIdleTimeHandler { |
mark_compacts_(0), |
scavenges_(0), |
long_idle_notifications_(0), |
+ idle_times_which_made_no_progress_per_mode_(0), |
mode_(kReduceLatency) {} |
GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state); |
@@ -238,6 +243,7 @@ class GCIdleTimeHandler { |
Mode NextMode(const HeapState& heap_state); |
GCIdleTimeAction Action(double idle_time_in_ms, const HeapState& heap_state, |
bool reduce_memory); |
+ GCIdleTimeAction NothingOrDone(); |
int idle_mark_compacts_; |
int mark_compacts_; |
@@ -245,6 +251,8 @@ class GCIdleTimeHandler { |
// The number of long idle notifications with no mutator GC happening |
// between the notifications. |
int long_idle_notifications_; |
+ // Idle notifications with no progress in the current mode. |
+ int idle_times_which_made_no_progress_per_mode_; |
Mode mode_; |