PC locks up with list operations

Steven D'Aprano steve+comp.lang.python at pearwood.info
Wed Aug 31 08:47:59 EDT 2011

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.
> Linux seems to fair badly when programs use more memory than physically
> available. Perhaps there's some per-process thing that can be used to
> limit things on Linux?

As far as I know, ulimit ("user limit") won't help. It can limit the amount
of RAM available to a process, but that just makes the process start using
virtual memory more quickly. It can also limit the amount of virtual memory
used by the shell, but not of other processes. In other words, Linux will
try really, really, really hard to give you the 84 gigabytes you've asked
for on a 2 GB system, even if it means DOSing your system for a month.

Of course, I would be very happy to learn I'm wrong.


More information about the Python-list mailing list