From a7c83d551507e459f44100ca61d2a7463a729950 Mon Sep 17 00:00:00 2001 From: Omer Katz Date: Mon, 23 Jan 2023 17:24:57 +0100 Subject: [PATCH] [heap] Double the max new space capacity for MinorMC The code still mostly refers to semi spaces when computing sizes. This will be renamed at a later date. Bug: v8:12612 Change-Id: Ib8f972493332425e971a35b0b892630a627810c8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4188382 Reviewed-by: Michael Lippautz Commit-Queue: Omer Katz Cr-Commit-Position: refs/heads/main@{#85536} --- src/heap/heap.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/heap/heap.cc b/src/heap/heap.cc index 832fe1bebf..7bd7ee1fdc 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc @@ -4894,6 +4894,13 @@ void Heap::ConfigureHeap(const v8::ResourceConstraints& constraints) { max_semi_space_size_ = SemiSpaceSizeFromYoungGenerationSize(young_generation_size); } + if (v8_flags.minor_mc) { + // The conditions above this one assume a new space implementation + // consisting of two equally sized semi spaces. If MinorMC is used, new + // space contains only a single space. Thus max size can be doubled + // without regressing memory. + max_semi_space_size_ *= 2; + } if (v8_flags.stress_compaction) { // This will cause more frequent GCs when stressing. max_semi_space_size_ = MB;