Commit 217c45b1 authored by jochen's avatar jochen Committed by Commit bot

Introduce a new growth criterion for the new space behind a flag

With this flag, we grow if more than 10% survived the last scavenge.

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

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

Cr-Commit-Position: refs/heads/master@{#25540}
parent 3adebeaa
...@@ -537,6 +537,9 @@ DEFINE_INT(max_semi_space_size, 0, ...@@ -537,6 +537,9 @@ DEFINE_INT(max_semi_space_size, 0,
"max size of a semi-space (in MBytes), the new space consists of two" "max size of a semi-space (in MBytes), the new space consists of two"
"semi-spaces") "semi-spaces")
DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space") DEFINE_INT(semi_space_growth_factor, 2, "factor by which to grow the new space")
DEFINE_BOOL(experimental_new_space_growth_heuristic, false,
"Grow the new space based on the percentage of survivors instead "
"of their absolute value.")
DEFINE_INT(max_old_space_size, 0, "max size of the old space (in Mbytes)") 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_INT(max_executable_size, 0, "max size of executable memory (in Mbytes)")
DEFINE_BOOL(gc_global, false, "always perform global GCs") DEFINE_BOOL(gc_global, false, "always perform global GCs")
......
...@@ -70,6 +70,7 @@ Heap::Heap() ...@@ -70,6 +70,7 @@ Heap::Heap()
// generation can be aligned to its size. // generation can be aligned to its size.
maximum_committed_(0), maximum_committed_(0),
survived_since_last_expansion_(0), survived_since_last_expansion_(0),
survived_last_scavenge_(0),
sweep_generation_(0), sweep_generation_(0),
always_allocate_scope_depth_(0), always_allocate_scope_depth_(0),
contexts_disposed_(0), contexts_disposed_(0),
...@@ -1301,11 +1302,18 @@ static void VerifyNonPointerSpacePointers(Heap* heap) { ...@@ -1301,11 +1302,18 @@ static void VerifyNonPointerSpacePointers(Heap* heap) {
void Heap::CheckNewSpaceExpansionCriteria() { void Heap::CheckNewSpaceExpansionCriteria() {
if (new_space_.TotalCapacity() < new_space_.MaximumCapacity() && if (FLAG_experimental_new_space_growth_heuristic) {
survived_since_last_expansion_ > new_space_.TotalCapacity()) { if (new_space_.TotalCapacity() < new_space_.MaximumCapacity() &&
// Grow the size of new space if there is room to grow, enough data survived_last_scavenge_ * 100 / new_space_.TotalCapacity() >= 10) {
// has survived scavenge since the last expansion and we are not in // Grow the size of new space if there is room to grow, and more than 10%
// high promotion mode. // have survived the last scavenge.
new_space_.Grow();
survived_since_last_expansion_ = 0;
}
} else if (new_space_.TotalCapacity() < new_space_.MaximumCapacity() &&
survived_since_last_expansion_ > new_space_.TotalCapacity()) {
// Grow the size of new space if there is room to grow, and enough data
// has survived scavenge since the last expansion.
new_space_.Grow(); new_space_.Grow();
survived_since_last_expansion_ = 0; survived_since_last_expansion_ = 0;
} }
......
...@@ -1195,6 +1195,7 @@ class Heap { ...@@ -1195,6 +1195,7 @@ class Heap {
inline void IncrementYoungSurvivorsCounter(int survived) { inline void IncrementYoungSurvivorsCounter(int survived) {
DCHECK(survived >= 0); DCHECK(survived >= 0);
survived_last_scavenge_ = survived;
survived_since_last_expansion_ += survived; survived_since_last_expansion_ += survived;
} }
...@@ -1506,6 +1507,9 @@ class Heap { ...@@ -1506,6 +1507,9 @@ class Heap {
// scavenge since last new space expansion. // scavenge since last new space expansion.
int survived_since_last_expansion_; int survived_since_last_expansion_;
// ... and since the last scavenge.
int survived_last_scavenge_;
// For keeping track on when to flush RegExp code. // For keeping track on when to flush RegExp code.
int sweep_generation_; int sweep_generation_;
......
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