Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Unified Diff: src/heap/heap.cc

Issue 753543002: Introduce a new growth criterion for the new space behind a flag (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 1c0eccaf68cf28b1e26a98bc5ab16e91fbb160fe..d728ec8c184c892d1759d49d010e31ff7de276ad 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -70,6 +70,7 @@ Heap::Heap()
// 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),
@@ -1301,11 +1302,18 @@ static void VerifyNonPointerSpacePointers(Heap* heap) {
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;
}
« no previous file with comments | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698