Commit 6e1aa65f authored by ulan's avatar ulan Committed by Commit bot

[heap] Ensure quick progress of incremental marking near OOM.

BUG=chromium:667388

Review-Url: https://codereview.chromium.org/2520963004
Cr-Commit-Position: refs/heads/master@{#41184}
parent d2e90c5d
...@@ -1852,6 +1852,10 @@ class Heap { ...@@ -1852,6 +1852,10 @@ class Heap {
return (OldGenerationCapacity() + size) < MaxOldGenerationSize(); return (OldGenerationCapacity() + size) < MaxOldGenerationSize();
} }
bool IsCloseToOutOfMemory(size_t slack) {
return OldGenerationCapacity() + slack >= MaxOldGenerationSize();
}
bool ShouldExpandOldGenerationOnAllocationFailure(); bool ShouldExpandOldGenerationOnAllocationFailure();
enum class IncrementalMarkingLimit { kNoLimit, kSoftLimit, kHardLimit }; enum class IncrementalMarkingLimit { kNoLimit, kSoftLimit, kHardLimit };
......
...@@ -1069,6 +1069,13 @@ size_t IncrementalMarking::StepSizeToMakeProgress() { ...@@ -1069,6 +1069,13 @@ size_t IncrementalMarking::StepSizeToMakeProgress() {
// target step count are chosen based on benchmarks. // target step count are chosen based on benchmarks.
const int kRampUpIntervalMs = 300; const int kRampUpIntervalMs = 300;
const size_t kTargetStepCount = 128; const size_t kTargetStepCount = 128;
const size_t kTargetStepCountAtOOM = 16;
size_t oom_slack = heap()->new_space()->Capacity() + 64 * MB;
if (heap()->IsCloseToOutOfMemory(oom_slack)) {
return heap()->PromotedSpaceSizeOfObjects() / kTargetStepCountAtOOM;
}
size_t step_size = Max(initial_old_generation_size_ / kTargetStepCount, size_t step_size = Max(initial_old_generation_size_ / kTargetStepCount,
IncrementalMarking::kAllocatedThreshold); IncrementalMarking::kAllocatedThreshold);
double time_passed_ms = double time_passed_ms =
......
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