Index: src/heap/incremental-marking-job.cc |
diff --git a/src/heap/incremental-marking-job.cc b/src/heap/incremental-marking-job.cc |
index a69dfac2fa6da95c428088b6f674b7be379c9f3c..f07d8b1a0253dceed3329b9131adb9d5fe8b19a0 100644 |
--- a/src/heap/incremental-marking-job.cc |
+++ b/src/heap/incremental-marking-job.cc |
@@ -14,6 +14,8 @@ |
namespace v8 { |
namespace internal { |
+const double IncrementalMarkingJob::kLongDelayInSeconds = 5; |
+const double IncrementalMarkingJob::kShortDelayInSeconds = 0.5; |
void IncrementalMarkingJob::Start(Heap* heap) { |
DCHECK(!heap->incremental_marking()->IsStopped()); |
@@ -58,8 +60,10 @@ void IncrementalMarkingJob::ScheduleDelayedTask(Heap* heap) { |
delayed_task_pending_ = true; |
made_progress_since_last_delayed_task_ = false; |
auto task = new DelayedTask(heap->isolate(), this); |
+ double delay = |
+ heap->HighMemoryPressure() ? kShortDelayInSeconds : kLongDelayInSeconds; |
V8::GetCurrentPlatform()->CallDelayedOnForegroundThread(isolate, task, |
- kDelayInSeconds); |
+ delay); |
} |
} |