[pypy-svn] r77386 - pypy/branch/smaller-writebarrier/pypy/rpython/memory/gc

arigo at codespeak.net arigo at codespeak.net
Sun Sep 26 18:10:04 CEST 2010


Author: arigo
Date: Sun Sep 26 18:10:02 2010
New Revision: 77386

Modified:
   pypy/branch/smaller-writebarrier/pypy/rpython/memory/gc/minimark.py
Log:
Change the default: now PYPY_GC_MIN defaults to 8 times the nursery
size, which is good to avoid spending all our time doing small major
collections if the program is not allocating much at all.


Modified: pypy/branch/smaller-writebarrier/pypy/rpython/memory/gc/minimark.py
==============================================================================
--- pypy/branch/smaller-writebarrier/pypy/rpython/memory/gc/minimark.py	(original)
+++ pypy/branch/smaller-writebarrier/pypy/rpython/memory/gc/minimark.py	Sun Sep 26 18:10:02 2010
@@ -248,13 +248,18 @@
                 newsize = generation.estimate_best_nursery_size()
                 if newsize <= 0:
                     newsize = defaultsize
+            newsize = max(newsize, minsize)
             #
             major_coll = base.read_float_from_env('PYPY_GC_MAJOR_COLLECT')
             if major_coll >= 1.0:
                 self.major_collection_threshold = major_coll
             #
             min_heap_size = base.read_uint_from_env('PYPY_GC_MIN')
-            self.min_heap_size = float(min_heap_size)
+            if min_heap_size > 0:
+                self.min_heap_size = float(min_heap_size)
+            else:
+                # defaults to 8 times the nursery
+                self.min_heap_size = newsize * 8
             #
             max_heap_size = base.read_uint_from_env('PYPY_GC_MAX')
             if max_heap_size > 0:
@@ -262,7 +267,7 @@
             #
             self.minor_collection()    # to empty the nursery
             llarena.arena_free(self.nursery)
-            self.nursery_size = max(newsize, minsize)
+            self.nursery_size = newsize
             self.allocate_nursery()
 
 



More information about the Pypy-commit mailing list