Commit d853a473 authored by Ulan Degenbaev's avatar Ulan Degenbaev Committed by Commit Bot

[heap] Simplify IncrementalMarking::StepSizeToMakeProgress.

This removes the ad-hoc ramp up period for the step size. The heuristic
was introduced before concurrent marking and is no longer useful.
The heuristic makes incremental marking progress very slow for short
running programs that do not allocate in the old generation.

Replace it with a simple cap on the step size in bytes.

Bug: v8:7253
Change-Id: If50fbd49e38135d006427f607c9a6d212c24fba7
Reviewed-on: https://chromium-review.googlesource.com/c/1288815Reviewed-by: 's avatarHannes Payer <hpayer@chromium.org>
Reviewed-by: 's avatarBenedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56807}
parent 41ba3d3e
......@@ -990,24 +990,18 @@ size_t IncrementalMarking::StepSizeToKeepUpWithAllocations() {
}
size_t IncrementalMarking::StepSizeToMakeProgress() {
// We increase step size gradually based on the time passed in order to
// leave marking work to standalone tasks. The ramp up duration and the
// target step count are chosen based on benchmarks.
const int kRampUpIntervalMs = 300;
const size_t kTargetStepCount = 256;
const size_t kTargetStepCountAtOOM = 32;
const size_t kMaxStepSizeInByte = 256 * KB;
size_t oom_slack = heap()->new_space()->Capacity() + 64 * MB;
if (!heap()->CanExpandOldGeneration(oom_slack)) {
return heap()->OldGenerationSizeOfObjects() / kTargetStepCountAtOOM;
}
size_t step_size = Max(initial_old_generation_size_ / kTargetStepCount,
IncrementalMarking::kMinStepSizeInBytes);
double time_passed_ms =
heap_->MonotonicallyIncreasingTimeInMs() - start_time_ms_;
double factor = Min(time_passed_ms / kRampUpIntervalMs, 1.0);
return static_cast<size_t>(factor * step_size);
return Min(Max(initial_old_generation_size_ / kTargetStepCount,
IncrementalMarking::kMinStepSizeInBytes),
kMaxStepSizeInByte);
}
void IncrementalMarking::AdvanceIncrementalMarkingOnAllocation() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment