Reviewers: jochen (slow), ulan, rmcilroy, Erik Corry Chromium.org,


https://codereview.chromium.org/1024043003/diff/1/src/heap/gc-idle-time-handler.cc
File src/heap/gc-idle-time-handler.cc (right):

https://codereview.chromium.org/1024043003/diff/1/src/heap/gc-idle-time-handler.cc#newcode227
src/heap/gc-idle-time-handler.cc:227: if
(IsMarkCompactIdleRoundFinished()) {
I am still not happy about the idle round concept. This one triggers
aggressively full garbage collections. Maybe it should be *perform
garbage collection if there was no garbage collection for a long time*.

https://codereview.chromium.org/1024043003/diff/1/test/cctest/test-api.cc
File test/cctest/test-api.cc (left):

https://codereview.chromium.org/1024043003/diff/1/test/cctest/test-api.cc#oldcode15763
test/cctest/test-api.cc:15763:
These tests are identical and do not test anything.

Description:
Simplified garbage collection idle handler.

BUG=

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

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

Affected files (+3, -56 lines):
  M src/heap/gc-idle-time-handler.cc
  M test/cctest/test-api.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 c74b46ea9b6d126b0770df551a830593198d63ef..784d83549a056fbb5ba34c814c365b7f5d1688d0 100644
--- a/src/heap/gc-idle-time-handler.cc
+++ b/src/heap/gc-idle-time-handler.cc
@@ -13,7 +13,7 @@ const double GCIdleTimeHandler::kConservativeTimeRatio = 0.9;
 const size_t GCIdleTimeHandler::kMaxMarkCompactTimeInMs = 1000;
const size_t GCIdleTimeHandler::kMaxFinalIncrementalMarkCompactTimeInMs = 1000;
 const size_t GCIdleTimeHandler::kMinTimeForFinalizeSweeping = 100;
-const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 7;
+const int GCIdleTimeHandler::kMaxMarkCompactsInIdleRound = 2;
 const int GCIdleTimeHandler::kIdleScavengeThreshold = 5;
 const double GCIdleTimeHandler::kHighContextDisposalRate = 100;
const size_t GCIdleTimeHandler::kMinTimeForOverApproximatingWeakClosureInMs = 1; @@ -236,23 +236,10 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time_in_ms,
     if (ShouldDoMarkCompact(static_cast<size_t>(idle_time_in_ms),
                             heap_state.size_of_objects,
heap_state.mark_compact_speed_in_bytes_per_ms)) { - // If there are no more than two GCs left in this idle round and we are - // allowed to do a full GC, then make those GCs full in order to compact
-      // the code space.
- // TODO(ulan): Once we enable code compaction for incremental marking, we - // can get rid of this special case and always start incremental marking.
-      int remaining_mark_sweeps =
- kMaxMarkCompactsInIdleRound - mark_compacts_since_idle_round_started_;
-      if (static_cast<size_t>(idle_time_in_ms) > kMaxScheduledIdleTime &&
-          (remaining_mark_sweeps <= 2 ||
-           !heap_state.can_start_incremental_marking)) {
-        return GCIdleTimeAction::FullGC();
-      }
-    }
-    if (!heap_state.can_start_incremental_marking) {
-      return GCIdleTimeAction::Nothing();
+      return GCIdleTimeAction::FullGC();
     }
   }
+
   // TODO(hpayer): Estimate finalize sweeping time.
   if (heap_state.sweeping_in_progress &&
static_cast<size_t>(idle_time_in_ms) >= kMinTimeForFinalizeSweeping) {
Index: test/cctest/test-api.cc
diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
index dcb11be19d1c84a377b2381a7d3929aff4bbe3a1..2288f44c6d82a92b255bfbbe40b14955b099b3fc 100644
--- a/test/cctest/test-api.cc
+++ b/test/cctest/test-api.cc
@@ -15742,46 +15742,6 @@ TEST(IdleNotification) {
 }


-// Test that idle notification can be handled and eventually collects garbage.
-TEST(IdleNotificationWithSmallHint) {
-  const intptr_t MB = 1024 * 1024;
-  const int IdlePauseInMs = 900;
-  LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
-  intptr_t initial_size = CcTest::heap()->SizeOfObjects();
-  CreateGarbageInOldSpace();
-  intptr_t size_with_garbage = CcTest::heap()->SizeOfObjects();
-  CHECK_GT(size_with_garbage, initial_size + MB);
-  bool finished = false;
-  for (int i = 0; i < 200 && !finished; i++) {
-    finished = env->GetIsolate()->IdleNotification(IdlePauseInMs);
-  }
-  intptr_t final_size = CcTest::heap()->SizeOfObjects();
-  CHECK(finished);
-  CHECK_LT(final_size, initial_size + 1);
-}
-
-
-// Test that idle notification can be handled and eventually collects garbage.
-TEST(IdleNotificationWithLargeHint) {
-  const intptr_t MB = 1024 * 1024;
-  const int IdlePauseInMs = 900;
-  LocalContext env;
-  v8::HandleScope scope(env->GetIsolate());
-  intptr_t initial_size = CcTest::heap()->SizeOfObjects();
-  CreateGarbageInOldSpace();
-  intptr_t size_with_garbage = CcTest::heap()->SizeOfObjects();
-  CHECK_GT(size_with_garbage, initial_size + MB);
-  bool finished = false;
-  for (int i = 0; i < 200 && !finished; i++) {
-    finished = env->GetIsolate()->IdleNotification(IdlePauseInMs);
-  }
-  intptr_t final_size = CcTest::heap()->SizeOfObjects();
-  CHECK(finished);
-  CHECK_LT(final_size, initial_size + 1);
-}
-
-
 TEST(Regress2333) {
   LocalContext env;
   for (int i = 0; i < 3; i++) {


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