Revision: 15554
Author:   [email protected]
Date:     Mon Jul  8 07:41:33 2013
Log: Fix estimation of released pages when collecting evacuation candidates.

Do at least two GCs in LowMemoryNotification.

[email protected]

Review URL: https://chromiumcodereview.appspot.com/18635006
http://code.google.com/p/v8/source/detail?r=15554

Modified:
 /branches/bleeding_edge/src/heap.cc
 /branches/bleeding_edge/src/mark-compact.cc

=======================================
--- /branches/bleeding_edge/src/heap.cc Mon Jul  8 03:02:16 2013
+++ /branches/bleeding_edge/src/heap.cc Mon Jul  8 07:41:33 2013
@@ -613,8 +613,10 @@
                                      kReduceMemoryFootprintMask);
   isolate_->compilation_cache()->Clear();
   const int kMaxNumberOfAttempts = 7;
+  const int kMinNumberOfAttempts = 2;
   for (int attempt = 0; attempt < kMaxNumberOfAttempts; attempt++) {
- if (!CollectGarbage(OLD_POINTER_SPACE, MARK_COMPACTOR, gc_reason, NULL)) { + if (!CollectGarbage(OLD_POINTER_SPACE, MARK_COMPACTOR, gc_reason, NULL) &&
+        attempt + 1 >= kMinNumberOfAttempts) {
       break;
     }
   }
=======================================
--- /branches/bleeding_edge/src/mark-compact.cc Wed Jul  3 08:39:18 2013
+++ /branches/bleeding_edge/src/mark-compact.cc Mon Jul  8 07:41:33 2013
@@ -781,10 +781,12 @@
   }

   if (FLAG_trace_fragmentation && mode == REDUCE_MEMORY_FOOTPRINT) {
- PrintF("Estimated over reserved memory: %.1f / %.1f MB (threshold %d)\n", + PrintF("Estimated over reserved memory: %.1f / %.1f MB (threshold %d), "
+           "evacuation candidate limit: %d\n",
            static_cast<double>(over_reserved) / MB,
            static_cast<double>(reserved) / MB,
-           static_cast<int>(kFreenessThreshold));
+           static_cast<int>(kFreenessThreshold),
+           max_evacuation_candidates);
   }

   intptr_t estimated_release = 0;
@@ -811,7 +813,7 @@
       if ((counter & 1) == (page_number & 1)) fragmentation = 1;
     } else if (mode == REDUCE_MEMORY_FOOTPRINT) {
       // Don't try to release too many pages.
-      if (estimated_release >= ((over_reserved * 3) / 4)) {
+      if (estimated_release >= over_reserved) {
         continue;
       }

@@ -828,7 +830,7 @@
       int free_pct = static_cast<int>(free_bytes * 100) / p->area_size();

       if (free_pct >= kFreenessThreshold) {
-        estimated_release += 2 * p->area_size() - free_bytes;
+        estimated_release += free_bytes;
         fragmentation = free_pct;
       } else {
         fragmentation = 0;

--
--
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/groups/opt_out.


Reply via email to