Reviewers: Hannes Payer,

Message:
PTAL

Description:
Use conservative heap growing factor for background tab.

BUG=chromium:515873
LOG=NO

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

Base URL: https://chromium.googlesource.com/v8/v8.git@master

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


Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 0432ee71fa0c329e6c1bf6e690883ab26f211a75..6a4acda903ed8cb6e7a95288b041f79197114b81 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -109,6 +109,7 @@ Heap::Heap()
 #endif  // DEBUG
       old_generation_allocation_limit_(initial_old_generation_size_),
       old_gen_exhausted_(false),
+      optimize_for_memory_usage_(false),
       inline_allocation_disabled_(false),
       store_buffer_rebuilder_(store_buffer()),
       hidden_string_(NULL),
@@ -4906,6 +4907,9 @@ void Heap::CheckAndNotifyBackgroundIdleNotification(double idle_time_in_ms,
     event.can_start_incremental_gc = incremental_marking()->IsStopped() &&
incremental_marking()->CanBeActivated();
     memory_reducer_.NotifyBackgroundIdleNotification(event);
+    optimize_for_memory_usage_ = true;
+  } else {
+    optimize_for_memory_usage_ = false;
   }
 }

@@ -5601,7 +5605,7 @@ void Heap::SetOldGenerationAllocationLimit(intptr_t old_gen_size,
   }

   if (freed_global_handles >= kFreedGlobalHandlesThreshold ||
-      memory_reducer_.ShouldGrowHeapSlowly()) {
+ memory_reducer_.ShouldGrowHeapSlowly() || optimize_for_memory_usage_) {
     factor = Min(factor, kConservativeHeapGrowingFactor);
   }

Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 54dfc7ae1a26da7fb32d5f3922da73012a72102a..750827968dcd757edff47ece2ed0948930aa688f 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1806,6 +1806,10 @@ class Heap {
   // last GC.
   bool old_gen_exhausted_;

+  // Indicates that memory usage is more important than latency.
+ // TODO(ulan): Merge it with memory reducer once chromium:490559 is fixed.
+  bool optimize_for_memory_usage_;
+
// Indicates that inline bump-pointer allocation has been globally disabled
   // for all spaces. This is used to disable allocations in generated code.
   bool inline_allocation_disabled_;


--
--
v8-dev mailing list
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to