| 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 6a39b78aaa2fcc24fd5210236f177bf0f9fffc14..f43576f57c90af70a8fc24f77839dae462310fa2 100644
|
| --- a/src/heap/gc-idle-time-handler.h
|
| +++ b/src/heap/gc-idle-time-handler.h
|
| @@ -138,6 +138,11 @@ class GCIdleTimeHandler {
|
|
|
| static const size_t kMinTimeForOverApproximatingWeakClosureInMs;
|
|
|
| + // Number of times we will return a Nothing action per Idle round 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 kMaxNoProgressIdleTimesPerIdleRound = 10;
|
| +
|
| class HeapState {
|
| public:
|
| void Print();
|
| @@ -159,7 +164,8 @@ class GCIdleTimeHandler {
|
|
|
| GCIdleTimeHandler()
|
| : mark_compacts_since_idle_round_started_(0),
|
| - scavenges_since_last_idle_round_(0) {}
|
| + scavenges_since_last_idle_round_(0),
|
| + idle_times_which_made_no_progress_since_last_idle_round_(0) {}
|
|
|
| GCIdleTimeAction Compute(double idle_time_in_ms, HeapState heap_state);
|
|
|
| @@ -203,7 +209,12 @@ class GCIdleTimeHandler {
|
| size_t new_space_allocation_throughput_in_bytes_per_ms);
|
|
|
| private:
|
| - void StartIdleRound() { mark_compacts_since_idle_round_started_ = 0; }
|
| + GCIdleTimeAction NothingOrDone();
|
| +
|
| + void StartIdleRound() {
|
| + mark_compacts_since_idle_round_started_ = 0;
|
| + idle_times_which_made_no_progress_since_last_idle_round_ = 0;
|
| + }
|
| bool IsMarkCompactIdleRoundFinished() {
|
| return mark_compacts_since_idle_round_started_ ==
|
| kMaxMarkCompactsInIdleRound;
|
| @@ -214,6 +225,7 @@ class GCIdleTimeHandler {
|
|
|
| int mark_compacts_since_idle_round_started_;
|
| int scavenges_since_last_idle_round_;
|
| + int idle_times_which_made_no_progress_since_last_idle_round_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(GCIdleTimeHandler);
|
| };
|
|
|