Reviewers: Michael Starzinger,

Message:
Fix for the low-memory devices.

Description:
Grow old generation slower on low-memory devices.

BUG=

Please review this at https://codereview.chromium.org/236063015/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files (+12, -2 lines):
  M src/heap.h
  M src/heap.cc


Index: src/heap.cc
diff --git a/src/heap.cc b/src/heap.cc
index 00e513ba880daa3fb9158af71cf57d6a91d1ace7..f2e9321a7a47087f84b567a57ccd1639908c259f 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -81,6 +81,7 @@ Heap::Heap()
 // Will be 4 * reserved_semispace_size_ to ensure that young
 // generation can be aligned to its size.
       maximum_committed_(0),
+      old_generation_growing_factor_(4),
       survived_since_last_expansion_(0),
       sweep_generation_(0),
       always_allocate_scope_depth_(0),
@@ -5952,6 +5953,12 @@ bool Heap::ConfigureHeap(int max_semispace_size,

   code_range_size_ = code_range_size;

+ // We set the old generation growing factor to 2 to grow the heap slower on
+  // low memory devices.
+  if (max_old_generation_size_ <= 256 * MB) {
+    old_generation_growing_factor_ = 2;
+  }
+
   configured_ = true;
   return true;
 }
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index 1f7526e71a58e146706c9b6922ab40c25164e457..85377c54be68d93271d6543565141f28e1b6c31c 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -1519,8 +1519,9 @@ class Heap {
       8 * (Page::kPageSize > MB ? Page::kPageSize : MB);

   intptr_t OldGenerationAllocationLimit(intptr_t old_gen_size) {
-    intptr_t limit = FLAG_stress_compaction ?
-        old_gen_size + old_gen_size / 10 : old_gen_size * 4;
+    intptr_t limit = FLAG_stress_compaction
+        ? old_gen_size + old_gen_size / 10
+        : old_gen_size * old_generation_growing_factor_;
     limit = Max(limit, kMinimumOldGenerationAllocationLimit);
     limit += new_space_.Capacity();
intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2;
@@ -1886,6 +1887,8 @@ class Heap {
   intptr_t max_executable_size_;
   intptr_t maximum_committed_;

+  int old_generation_growing_factor_;
+
   // For keeping track of how much data has survived
   // scavenge since last new space expansion.
   int survived_since_last_expansion_;


--
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to