Commit 8ac88b6a authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] Avoid growing initial limit when heap is not yet configured

Avoid the case where the application runs behind an initial limit that grows in
the case where the heap is not yet configured.

Bug: chromium:924180
Change-Id: I45184f95cb00d65469574bdc40d4596ef50d9c60
Reviewed-on: https://chromium-review.googlesource.com/c/1426960Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59010}
parent df071e94
...@@ -2411,13 +2411,18 @@ void Heap::UnregisterArrayBuffer(JSArrayBuffer buffer) { ...@@ -2411,13 +2411,18 @@ void Heap::UnregisterArrayBuffer(JSArrayBuffer buffer) {
void Heap::ConfigureInitialOldGenerationSize() { void Heap::ConfigureInitialOldGenerationSize() {
if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) { if (!old_generation_size_configured_ && tracer()->SurvivalEventsRecorded()) {
old_generation_allocation_limit_ = const size_t new_limit =
Max(OldGenerationSizeOfObjects() + Max(OldGenerationSizeOfObjects() +
heap_controller()->MinimumAllocationLimitGrowingStep( heap_controller()->MinimumAllocationLimitGrowingStep(
CurrentHeapGrowingMode()), CurrentHeapGrowingMode()),
static_cast<size_t>( static_cast<size_t>(
static_cast<double>(old_generation_allocation_limit_) * static_cast<double>(old_generation_allocation_limit_) *
(tracer()->AverageSurvivalRatio() / 100))); (tracer()->AverageSurvivalRatio() / 100)));
if (new_limit < old_generation_allocation_limit_) {
old_generation_allocation_limit_ = new_limit;
} else {
old_generation_size_configured_ = true;
}
} }
} }
......
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