[pypy-svn] r79447 - pypy/branch/jit-free/pypy/rpython/memory/gc

arigo at codespeak.net arigo at codespeak.net
Wed Nov 24 11:42:46 CET 2010


Author: arigo
Date: Wed Nov 24 11:42:45 2010
New Revision: 79447

Modified:
   pypy/branch/jit-free/pypy/rpython/memory/gc/minimark.py
Log:
Merge r79446.


Modified: pypy/branch/jit-free/pypy/rpython/memory/gc/minimark.py
==============================================================================
--- pypy/branch/jit-free/pypy/rpython/memory/gc/minimark.py	(original)
+++ pypy/branch/jit-free/pypy/rpython/memory/gc/minimark.py	Wed Nov 24 11:42:45 2010
@@ -205,7 +205,7 @@
         self.min_heap_size = 0.0
         self.max_heap_size = 0.0
         self.max_heap_size_already_raised = False
-        self.max_delta = 0.0
+        self.max_delta = float(r_uint(-1))
         #
         self.card_page_indices = card_page_indices
         if self.card_page_indices > 0:
@@ -359,9 +359,6 @@
         # Set the next_major_collection_threshold.
         threshold_max = (self.next_major_collection_threshold *
                          self.growth_rate_max)
-        if self.max_delta > 0.0:
-            threshold_max = min(threshold_max,
-                         self.next_major_collection_threshold + self.max_delta)
         if threshold > threshold_max:
             threshold = threshold_max
         #
@@ -1262,9 +1259,12 @@
         #
         # Set the threshold for the next major collection to be when we
         # have allocated 'major_collection_threshold' times more than
+        # we currently have -- but no more than 'max_delta' more than
         # we currently have.
+        total_memory_used = float(self.get_total_memory_used())
         bounded = self.set_major_threshold_from(
-            self.get_total_memory_used() * self.major_collection_threshold,
+            min(total_memory_used * self.major_collection_threshold,
+                total_memory_used + self.max_delta),
             reserving_size)
         #
         # Max heap size: gives an upper bound on the threshold.  If we



More information about the Pypy-commit mailing list