Reviewers: ulan,

Description:
When context disposal rate is high and we cannot perform a full GC, we do
nothing until the context disposal rate becomes lower.

BUG=chromium:473351
LOG=n

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

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

Affected files (+11, -5 lines):
  M src/heap/gc-idle-time-handler.cc


Index: src/heap/gc-idle-time-handler.cc
diff --git a/src/heap/gc-idle-time-handler.cc b/src/heap/gc-idle-time-handler.cc index a3383b9c0c0dcde34864a7fbbafef853d24d5d55..d80da0036fced5d8e2c0f70a97a5a2b0a029c862 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -202,18 +202,20 @@ GCIdleTimeAction GCIdleTimeHandler::NothingOrDone() {
 // (1) If we don't have any idle time, do nothing, unless a context was
 // disposed, incremental marking is stopped, and the heap is small. Then do
 // a full GC.
-// (2) If the new space is almost full and we can afford a Scavenge or if the +// (2) If the context disposal rate is high and we cannot perform a full GC,
+// we do nothing until the context disposal rate becomes lower.
+// (3) If the new space is almost full and we can affort a Scavenge or if the
 // next Scavenge will very likely take long, then a Scavenge is performed.
-// (3) If there is currently no MarkCompact idle round going on, we start a
+// (4) If there is currently no MarkCompact idle round going on, we start a
// new idle round if enough garbage was created. Otherwise we do not perform
 // garbage collection to keep system utilization low.
-// (4) If incremental marking is done, we perform a full garbage collection
+// (5) If incremental marking is done, we perform a full garbage collection
 // if  we are allowed to still do full garbage collections during this idle
// round or if we are not allowed to start incremental marking. Otherwise we
 // do not perform garbage collection to keep system utilization low.
-// (5) If sweeping is in progress and we received a large enough idle time
+// (6) If sweeping is in progress and we received a large enough idle time
 // request, we finalize sweeping here.
-// (6) If incremental marking is in progress, we perform a marking step. Note, +// (7) If incremental marking is in progress, we perform a marking step. Note,
 // that this currently may trigger a full garbage collection.
 GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time_in_ms,
                                             HeapState heap_state) {
@@ -231,6 +233,10 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time_in_ms,
     return GCIdleTimeAction::Nothing();
   }

+  if (heap_state.contexts_disposal_rate < kHighContextDisposalRate) {
+    return GCIdleTimeAction::Nothing();
+  }
+
   if (ShouldDoScavenge(
static_cast<size_t>(idle_time_in_ms), heap_state.new_space_capacity,
           heap_state.used_new_space_size,


--
--
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