From: hpayer@chromium.org Date: Thu, 12 Jun 2014 12:39:51 +0000 (+0000) Subject: Grow big old generation slower. X-Git-Tag: upstream/4.7.83~8705 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9f80d07641cf00954c260c45f083f0e5c128a6bc;p=platform%2Fupstream%2Fv8.git Grow big old generation slower. BUG= R=ulan@chromium.org Review URL: https://codereview.chromium.org/324403008 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21808 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/heap.cc b/src/heap.cc index 21a5094..d9a4279 100644 --- a/src/heap.cc +++ b/src/heap.cc @@ -60,7 +60,6 @@ Heap::Heap() // Will be 4 * reserved_semispace_size_ to ensure that young // generation can be aligned to its size. maximum_committed_(0), - old_space_growing_factor_(4), survived_since_last_expansion_(0), sweep_generation_(0), always_allocate_scope_depth_(0), @@ -5026,12 +5025,6 @@ bool Heap::ConfigureHeap(int max_semi_space_size, code_range_size_ = code_range_size * MB; - // We set the old generation growing factor to 2 to grow the heap slower on - // memory-constrained devices. - if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) { - old_space_growing_factor_ = 2; - } - configured_ = true; return true; } diff --git a/src/heap.h b/src/heap.h index 7d9233b..b9da734 100644 --- a/src/heap.h +++ b/src/heap.h @@ -1085,9 +1085,23 @@ class Heap { 700 * kPointerMultiplier; intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) { - intptr_t limit = FLAG_stress_compaction - ? old_gen_size + old_gen_size / 10 - : old_gen_size * old_space_growing_factor_; + intptr_t limit; + if (FLAG_stress_compaction) { + limit = old_gen_size + old_gen_size / 10; + } else if (old_gen_size < max_old_generation_size_ / 8) { + if (max_old_generation_size_ <= kMaxOldSpaceSizeMediumMemoryDevice) { + limit = old_gen_size * 2; + } else { + limit = old_gen_size * 4; + } + } else if (old_gen_size < max_old_generation_size_ / 4) { + limit = static_cast(old_gen_size * 1.5); + } else if (old_gen_size < max_old_generation_size_ / 2) { + limit = static_cast(old_gen_size * 1.2); + } else { + limit = static_cast(old_gen_size * 1.1); + } + limit = Max(limit, kMinimumOldGenerationAllocationLimit); limit += new_space_.Capacity(); intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; @@ -1512,11 +1526,6 @@ class Heap { intptr_t max_executable_size_; intptr_t maximum_committed_; - // The old space growing factor is used in the old space heap growing - // strategy. The new old space size is the current old space size times - // old_space_growing_factor_. - int old_space_growing_factor_; - // For keeping track of how much data has survived // scavenge since last new space expansion. int survived_since_last_expansion_;