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

Unified Diff: src/heap/heap.cc

Issue 734363002: Introduce an option to do regular new space growing for a while (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') | src/heap/spaces.h » ('j') | 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 9785be0b91d59785a5b38a6da7ac38006ed8bfa2..8c76cfb8d1f1f21a6bfaea0e07c0d29845aac678 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -62,6 +62,7 @@ Heap::Heap()
max_semi_space_size_(8 * (kPointerSize / 4) * MB),
initial_semispace_size_(Page::kPageSize),
target_semispace_size_(Page::kPageSize),
+ scavenges_before_grow_(0),
max_old_generation_size_(700ul * (kPointerSize / 4) * MB),
max_executable_size_(256ul * (kPointerSize / 4) * MB),
// Variables set based on semispace_size_ and old_generation_size_ in
@@ -1570,6 +1571,12 @@ void Heap::Scavenge() {
IncrementYoungSurvivorsCounter(static_cast<int>(
(PromotedSpaceSizeOfObjects() - survived_watermark) + new_space_.Size()));
+ if (scavenges_before_grow_ > 0) {
+ if (--scavenges_before_grow_ == 0) {
+ new_space()->set_grow_to_target_capacity(true);
+ }
+ }
+
LOG(isolate_, ResourceEvent("scavenge", "end"));
gc_state_ = NOT_IN_GC;
@@ -5059,6 +5066,8 @@ bool Heap::ConfigureHeap(int max_semi_space_size, int max_old_space_size,
target_semispace_size_ = Max(initial_semispace_size_, target_semispace_size_);
+ scavenges_before_grow_ = Max(FLAG_scavenges_before_grow, 0);
+
// 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_ =
@@ -5241,6 +5250,9 @@ bool Heap::SetUp() {
return false;
}
new_space_top_after_last_gc_ = new_space()->top();
+ if (scavenges_before_grow_ <= 0) {
+ new_space()->set_grow_to_target_capacity(true);
+ }
// Initialize old pointer space.
old_pointer_space_ = new OldSpace(this, max_old_generation_size_,
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698