[pypy-dev] Fatal RPython error: MemoryError

Armin Rigo arigo at tunes.org
Wed Aug 8 10:09:44 CEST 2012

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

A bientôt,


More information about the pypy-dev mailing list