Commit 34363bf5 authored by jochen's avatar jochen Committed by Commit bot

Introduce a flag to change the new space growth factor

A useful value would be 4, so we get 1, 4, 16MB (instead of the default
value 2 which leads to 1, 2, 4, 8, 16)

BUG=none
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/753513002

Cr-Commit-Position: refs/heads/master@{#25462}
parent dad405a2
......@@ -530,6 +530,7 @@ DEFINE_INT(target_semi_space_size, 0,
DEFINE_INT(max_semi_space_size, 0,
"max size of a semi-space (in MBytes), the new space consists of two"
"semi-spaces")
DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)")
DEFINE_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)")
DEFINE_BOOL(gc_global, false, "always perform global GCs")
......
......@@ -5059,6 +5059,10 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
target_semispace_size_ = Max(initial_semispace_size_, target_semispace_size_);
if (FLAG_semi_space_growth_factor < 2) {
FLAG_semi_space_growth_factor = 2;
}
// The old generation is paged and needs at least one page for each space.
int paged_space_count = LAST_PAGED_SPACE - FIRST_PAGED_SPACE + 1;
max_old_generation_size_ =
......
......@@ -1313,7 +1313,8 @@ void NewSpace::Grow() {
// Double the semispace size but only up to maximum capacity.
DCHECK(TotalCapacity() < MaximumCapacity());
int new_capacity =
Min(MaximumCapacity(), 2 * static_cast<int>(TotalCapacity()));
Min(MaximumCapacity(),
FLAG_semi_space_growth_factor * static_cast<int>(TotalCapacity()));
if (to_space_.GrowTo(new_capacity)) {
// Only grow from space if we managed to grow to-space.
if (!from_space_.GrowTo(new_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