[Tutor] Question about the memory manager

Oscar Benjamin oscar.j.benjamin at gmail.com
Mon Jan 11 10:10:47 EST 2016


On 11 January 2016 at 12:15, Alan Gauld <alan.gauld at btinternet.com> wrote:
>
> But I think that it definitely is heavily OS dependent.
> It should work in most *nix environments the first time
> you call the function. But on second call I'd expect
> all bets to be off. And in most real-time OS's memory
> goes right back to the OS pool - but even there it
> would probably be available I guess, at least the first
> time.
>
> Maybe the theory is that if you get a memory error the
> only sensible thing is just to log it and exit. In which
> case you only ever call this once.
>
> Steven, Did you try any experiments? I'm struggling
> to come up with a reliable test scenario.

I can't even work out how you trigger a MemoryError on Linux (apart
from just raising one). I've tried a few ways to make the system run
out of memory and it just borks the system rather than raise any error
- I can only interrupt it with REISUB.

Here's a simple one:

$ python -c 'x = []; x.append(iter(x))'

(Make sure you save all your work before trying that!)

--
Oscar


More information about the Tutor mailing list