[pypy-dev] Fatal RPython error: MemoryError

Roger Flores aidembb at yahoo.com
Wed Aug 8 18:54:43 CEST 2012


>Well, overall we need first someone to care about sanitizing the GC
>first.  When the GC raises an RPython MemoryError in the middle of a
>minor collection, it probably leaves things in a broken state.  It

Again, perhaps this could be avoided for now.  Could the rpython_reserve be set high enough so that minor collections always succeed?  10KB?  100KB?  Basically get it working as desired first, then go back and optimize memory sizes and collection cycles when someone can.

Fun stat: pypy for my PPM app can store twice as much data as python in the 2GB of RAM!  So using a silly huge number for the reserve memories still puts pypy well ahead in the memory issues.  That is, if python doesn't need to be more careful as well.


>We can't suddenly print the stack trace of the application from inside
...

>a function from there.  This takes a lot of extra memory.

OK.  It sounds like it already works, just needs a large rpython_reserve.  Again, pick a large number, show it works, optimize later?



-Roger



________________________________
 From: Armin Rigo <arigo at tunes.org>
To: Roger Flores <aidembb at yahoo.com> 
Cc: "pypy-dev at python.org" <pypy-dev at python.org> 
Sent: Wednesday, August 8, 2012 1:09 AM
Subject: Re: [pypy-dev] Fatal RPython error: MemoryError
 
Hi Eli, hi Roger,

Both of your solutions might work.

Roger, you overlook a problem in this pseudo-code:

>             print 'MemoryError'
>             print stack_trace() # of app

We can't suddenly print the stack trace of the application from inside
the GC.  In order to have a regular stack trace printed, an exception
must be raised, which is caught and re-raised by the various levels,
collecting stack information in (new) PyTraceback objects; then, in
PyPy, we need to import (at app-level) the "traceback" module and call
a function from there.  This takes a lot of extra memory.

Well, overall we need first someone to care about sanitizing the GC
first.  When the GC raises an RPython MemoryError in the middle of a
minor collection, it probably leaves things in a broken state.  It
didn't show up so far because you can't do anything anyway but get the
crash.


A bientôt,

Armin.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120808/7a49e58c/attachment.html>


More information about the pypy-dev mailing list