Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: l = range(int(1E9)) Date: Thu, 30 Apr 2015 16:33:58 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 19 Message-ID: References: <87k2wtvbx1.fsf@Equus.decebal.nl> NNTP-Posting-Host: 67-130-15-94.dia.static.qwest.net X-Trace: reader1.panix.com 1430411638 26967 67.130.15.94 (30 Apr 2015 16:33:58 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Thu, 30 Apr 2015 16:33:58 +0000 (UTC) User-Agent: slrn/1.0.1 (Linux) Xref: csiph.com comp.lang.python:89640 On 2015-04-30, Cecil Westerhof 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??