Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeder.news-service.com!xlned.com!feeder7.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.039 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'raised': 0.07; 'python': 0.08; 'locked': 0.09; 'am,': 0.12; 'tries': 0.15; 'mylist': 0.16; 'stupid,': 0.16; 'cc:addr:python-list': 0.16; 'wrote:': 0.16; 'linux': 0.17; 'subject:list': 0.18; 'received:209.85.210.174': 0.18; 'received:mail-iy0-f174.google.com': 0.18; 'memory': 0.21; 'cc:2**0': 0.22; 'header:In-Reply-To:1': 0.22; 'versions': 0.23; 'aug': 0.24; 'up.': 0.26; "i'm": 0.27; 'skip:[ 10': 0.27; 'url:mailman': 0.28; 'second': 0.29; 'script': 0.29; 'cc:addr:python.org': 0.30; 'hours,': 0.30; 'list': 0.32; 'sort': 0.33; 'too': 0.33; 'there': 0.33; 'url:listinfo': 0.33; 'message- id:@gmail.com': 0.34; 'like:': 0.34; 'running': 0.35; 'anything': 0.36; 'charset:us-ascii': 0.36; 'couple': 0.36; 'url:python': 0.36; 'machine': 0.37; 'using': 0.37; 'but': 0.37; 'something': 0.37; 'steven': 0.38; 'received:google.com': 0.38; 'url:org': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'header:Mime- Version:1': 0.39; 'subject:with': 0.39; 'happens': 0.40; 'more': 0.60; 'header:Message-Id:1': 0.61; 'waiting': 0.63; '31,': 0.64; 'man': 0.65; 'iphone': 0.68; 'weeks,': 0.77; 'instruct': 0.84; 'received:10.32': 0.84; 'incidents': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=references:in-reply-to:mime-version:content-transfer-encoding :content-type:message-id:cc:x-mailer:from:subject:date:to; bh=zeOhH4zsvXODQq5gsRzfH6WJq5iI/7IpNf7GtoQxv3I=; b=VNPumDC0Ucw6klv+aeHjejYwHTQZbCBqnAOsvQyXeLix0YHEL5/uWkyKeUzOoBA06p UljkMN8Gtc320ZhRFuzQ02n86DOP9ujNhXogVyfEW9IHrxU95ZiVZM1BgHtKAu9T6pX3 34wdEVmga16xZKHUDFsPXgiqotVtgxlZq0DO4= References: <4e5e2a0c$0$29965$c3e8da3$5496439d@news.astraweb.com> In-Reply-To: <4e5e2a0c$0$29965$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 (iPhone Mail 8L1) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii X-Mailer: iPhone Mail (8L1) From: Rodrick Brown Subject: Re: PC locks up with list operations Date: Wed, 31 Aug 2011 10:13:02 -0400 To: Steven D'Aprano Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1314799993 news.xs4all.nl 2425 [2001:888:2000:d::a6]:40700 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:12477 $ man limits.conf=20 Sent from my iPhone On Aug 31, 2011, at 8:33 AM, Steven D'Aprano wrote: > Twice in a couple of weeks, I have locked up my PC by running a Python 2.5= > script that tries to create a list that is insanely too big. >=20 > In the first case, I (stupidly) did something like: >=20 > mylist =3D [0]*12345678901234 >=20 > After leaving the machine for THREE DAYS (!!!) I eventually was able to ge= t > to a console and kill the Python process. Amazingly, it never raised > MemoryError in that time. >=20 > The second time was a little less stupid, but not much: >=20 > mylist =3D [] > for x in itertools.combinations_with_replacement(some_big_list, 20): > mylist.append(func(x)) >=20 > After three hours, the desktop is still locked up. I'm waiting to see what= > happens in the morning before rebooting. >=20 > Apart from "Then don't do that!", is there anything I can do to prevent th= is > sort of thing in the future? Like instruct Python not to request more > memory than my PC has? >=20 > 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? >=20 >=20 >=20 > --=20 > Steven >=20 > --=20 > http://mail.python.org/mailman/listinfo/python-list