[pypy-dev] Problem with large allocation in test

Vincent Legoll vincent.legoll at gmail.com
Tue Apr 19 14:02:43 CEST 2011


Hello

On Tue, Apr 19, 2011 at 10:10 AM, Armin Rigo <arigo at tunes.org> wrote:
> 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.

Wouldn't a big read only mmap from /dev/zero before the to be jumped
adress allow for not really trying to allocate the big chunk of RAM ?

That may be a good fix, still allowing the test for far jumps...

-- 
Vincent Legoll



More information about the Pypy-dev mailing list