"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_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_executable_size, 0, "max size of executable memory (in Mbytes)")
DEFINE_BOOL(gc_global, false, "always perform global GCs")
// generation can be aligned to its size.
maximum_committed_(0),
survived_since_last_expansion_(0),
+ survived_last_scavenge_(0),
sweep_generation_(0),
always_allocate_scope_depth_(0),
contexts_disposed_(0),
void Heap::CheckNewSpaceExpansionCriteria() {
- 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, enough data
- // has survived scavenge since the last expansion and we are not in
- // high promotion mode.
+ if (FLAG_experimental_new_space_growth_heuristic) {
+ if (new_space_.TotalCapacity() < new_space_.MaximumCapacity() &&
+ survived_last_scavenge_ * 100 / new_space_.TotalCapacity() >= 10) {
+ // Grow the size of new space if there is room to grow, and more than 10%
+ // 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();
survived_since_last_expansion_ = 0;
}
inline void IncrementYoungSurvivorsCounter(int survived) {
DCHECK(survived >= 0);
+ survived_last_scavenge_ = survived;
survived_since_last_expansion_ += survived;
}
// scavenge since last new space expansion.
int survived_since_last_expansion_;
+ // ... and since the last scavenge.
+ int survived_last_scavenge_;
+
// For keeping track on when to flush RegExp code.
int sweep_generation_;