l = range(int(1E9))

Grant Edwards invalid at invalid.invalid
Thu Apr 30 18:33:58 CEST 2015


On 2015-04-30, Cecil Westerhof <Cecil at decebal.nl> wrote:
> If I execute:
>     l = range(int(1E9)
>
> The python process gobbles up all the memory and is killed. The
> problem is that after this my swap is completely used, because other
> processes have swapped to it. This make those programs more slowly.
> Is there a way to circumvent Python claiming all the memory?

I presume "don't do that" has already occured to you?

You can always use ulimit to limit the memory allowed for the process
running Python.

-- 
Grant Edwards               grant.b.edwards        Yow! Should I get locked
                                  at               in the PRINCICAL'S
                              gmail.com            OFFICE today -- or have
                                                   a VASECTOMY??



More information about the Python-list mailing list