Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r68592:5a2d56ec4bac
Date: 2014-01-10 11:06 +0100
http://bitbucket.org/pypy/pypy/changeset/5a2d56ec4bac/

Log:    Decrement the raw-memory-pressure counters by 'sizehint' plus a
        little bit extra. This is needed e.g. for _rawffi, which may
        allocate a lot of tiny arrays.

diff --git a/rpython/memory/gc/incminimark.py b/rpython/memory/gc/incminimark.py
--- a/rpython/memory/gc/incminimark.py
+++ b/rpython/memory/gc/incminimark.py
@@ -864,7 +864,10 @@
                 self.next_major_collection_threshold = self.max_heap_size
 
     def raw_malloc_memory_pressure(self, sizehint):
-        self.next_major_collection_threshold -= sizehint
+        # Decrement by 'sizehint' plus a very little bit extra.  This
+        # is needed e.g. for _rawffi, which may allocate a lot of tiny
+        # arrays.
+        self.next_major_collection_threshold -= (sizehint + 2 * WORD)
         if self.next_major_collection_threshold < 0:
             # cannot trigger a full collection now, but we can ensure
             # that one will occur very soon
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to