Commit b2f75b00 authored by Maggie Chen's avatar Maggie Chen Committed by Commit Bot

Finch:increase max_old_space_size to 4 GB based on availability of physical memory

This is for the finch experiment CL 1592792 V8HugeMaxOldGenerationSize
(--js-flags="huge_max_old_generation_size").
The purpose of this finch is to support web apps that require more heap
space for their data sets.

The current max_old_space_size is 2 GB. This CL increases the size to 4 GB for
64-bit systems with a physical memory size bigger than 16 GB. This CL does not
change MaxGrowingFactor. HeapController::kMaxSize is still set to 2GB so the
GC schedule remains the same.

All tests from "tools\dev\gm.py x64.release.check" passes in my local machine
with FLAG_increase_max_old_space_size forced to true.

Bug:958974

Change-Id: I9d916d75c0b16342040dd1336e28e423e5bcc474
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1592129
Commit-Queue: Maggie Chen <magchen@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#61297}
parent 4d4fe18d
......@@ -742,6 +742,9 @@ DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
"Grow the new space based on the percentage of survivors instead "
"of their absolute value.")
DEFINE_SIZE_T(max_old_space_size, 0, "max size of the old space (in Mbytes)")
DEFINE_BOOL(huge_max_old_generation_size, false,
"Increase max size of the old space to 4 GB for x64 systems with"
"the physical memory bigger than 16 GB")
DEFINE_SIZE_T(initial_old_space_size, 0, "initial old space size (in Mbytes)")
DEFINE_BOOL(gc_global, false, "always perform global GCs")
DEFINE_INT(random_gc_interval, 0,
......
......@@ -216,8 +216,18 @@ size_t Heap::ComputeMaxOldGenerationSize(uint64_t physical_memory) {
size_t computed_size = static_cast<size_t>(physical_memory / i::MB /
old_space_physical_memory_factor *
kPointerMultiplier);
return Max(Min(computed_size, HeapController::kMaxSize),
HeapController::kMinSize);
size_t max_size_in_mb = HeapController::kMaxSize;
// Finch experiment: Increase the heap size from 2GB to 4GB for 64-bit
// systems with physical memory bigger than 16GB.
constexpr bool x64_bit = Heap::kPointerMultiplier >= 2;
if (FLAG_huge_max_old_generation_size && x64_bit &&
physical_memory / GB > 16) {
DCHECK_LE(max_size_in_mb, 4096);
max_size_in_mb = 4096; // 4GB
}
return Max(Min(computed_size, max_size_in_mb), HeapController::kMinSize);
}
size_t Heap::Capacity() {
......
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