[pypy-dev] Problem with large allocation in test

Armin Rigo arigo at tunes.org
Tue Apr 19 10:10:40 CEST 2011


Hi Joe,

On Tue, Apr 19, 2011 at 8:23 AM, Maciej Fijalkowski <fijall at gmail.com> wrote:
>>> Anyway, after I went into ll2ctypes.py and set far_regions to True

This is a correct workaround, indeed.  As you found out the problem
comes from the fact that your OS reserves actual RAM from mmap()
eagerly.  As Maciej points out, it's useful to test e.g. jumps over
more than +/-2GB.  But the same result could potentially be obtained
in a different way: instead of allocating a single block of 20GB, we
could mmap 10 blocks of (say) 20MB for the test, but taking care of
placing the blocks so that they start 2GB apart from each other.  This
could be done using pypy.rlib.rmmap.alloc() or a variant.


A bientôt,

Armin.



More information about the Pypy-dev mailing list