On 4/30/2015 12:06 PM, Cecil Westerhof wrote:
If I execute:
     l = range(int(1E9)

you get a SyntaxError

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?

For this specific case, use xrange or 3.x range

By the way: this is CPython 2.7.8.



--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to