PC locks up with list operations

Robert Spanjaard spamtrap at arumes.com
Wed Aug 31 16:06:43 CEST 2011


On 08/31/2011 02:40 PM, Chris Withers wrote:
> On 31/08/2011 13:33, Steven D'Aprano wrote:
>> I am using Linux desktops; both incidents were with Python 2.5. Do newer
>> versions of Python respond to this sort of situation more gracefully?
>
> Ironically, Windows does better here and dumps you out with a
> MemoryError before slowly recovering.

I think it's a little premature to make such a statement based on a single 
user experience. I've used Linux for six years now, and it NEVER locked up, 
even when a program leaks memory like hell.
I can't duplicate the OP's behaviour because my Python (2.6.5, 64 bit) does 
generate an instant MemoryError (which answers the question, ofcourse), but 
I've used a VLC version that had a nasty leak. My swap space is on a SSD, 
and VLC filled it completely in about 10 seconds. But then, VLC got killed 
automatically, and the system recovered gracefully.
On a system with the swapspace on a regular HD, the same will happen, but 
it'll take more time. And while VLC is filling the swap space, the system 
does not lock up at all. You can still keep working, and (for example) fire 
up the process manager and kill VLC yourself.

 >>> mylist = [0]*12345678901234
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
MemoryError

-- 
Regards, Robert                                      http://www.arumes.com



More information about the Python-list mailing list