Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!aioe.org!feeder.news-service.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'subject:Python': 0.04; 'memory.': 0.05; 'consume': 0.09; 'severely': 0.09; 'this:': 0.11; 'am,': 0.14; 'wrote:': 0.14; 'starts': 0.15; '*before*': 0.16; "clients'": 0.16; 'extensions,': 0.16; 'subject:memory': 0.16; 'stuff': 0.18; 'obviously': 0.20; 'code,': 0.20; '(which': 0.21; 'header:In-Reply-To:1': 0.22; 'thu,': 0.22; 'received:209.85.214.174': 0.23; 'received:mail- iw0-f174.google.com': 0.23; 'restrict': 0.23; 'runs': 0.24; "i'm": 0.26; 'chris': 0.27; 'message-id:@mail.gmail.com': 0.28; 'subject:?': 0.29; 'be.': 0.29; 'lock': 0.31; 'does': 0.31; "can't": 0.31; 'to:addr:python-list': 0.32; 'things': 0.33; 'hoping': 0.36; 'too': 0.36; 'rather': 0.36; 'case,': 0.36; 'else': 0.37; 'some': 0.37; 'received:209.85': 0.37; 'apr': 0.38; 'be,': 0.38; 'received:google.com': 0.38; 'but': 0.38; 'received:209.85.214': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.39; 'hosting': 0.39; 'header:Received:5': 0.40; '2011': 0.62; 'physical': 0.74; 'node': 0.84; 'stupid': 0.84; 'subject:limits': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=4itv03I/JPGKiSUIj9iPHJQaXZr7Hc7x2GfO3MmETkQ=; b=CqvC9ydj2PoQVtD6lZ+761bmnYav73x7mVdgrfcQWFFwa1t3a/9pB4BVZ+N/vIWhGS 6GfZmJ2SGEJCUoVHRs6g1fo8MMYPY69suRwvlsLngIIQTPAJE2L1SguypB37RnMGMkYq 3Ian209ShTdcUz5jvshsp6914YwSDBwI5T3NA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=PAkkeCA7j2oLrLbN50eXgo0ZD6PIywXwXxxKARzQnCf3g2ACavExptczXbP5whIeDR iWNlrxtLRY8snpDb+BfXYEb9wwM9iscuOEDz3vH3CaUJyZ6PV7svb1KDzX1Zp0B+zk2A 3wKzUmqs9/0sec9/wccefJh7VsdiCNaz6sIOA= MIME-Version: 1.0 In-Reply-To: References: Date: Thu, 7 Apr 2011 10:10:33 +1000 Subject: Re: Sandboxed Python: memory limits? From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 20 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1302135041 news.xs4all.nl 41110 [::ffff:82.94.164.166]:51984 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:2731 On Thu, Apr 7, 2011 at 10:06 AM, Chris Angelico wrote: > I'm not too concerned about extensions, here; in any case, I lock most > of them off. I just want to prevent stupid stuff like this: > > a=3D'a' > while True: > =A0 =A0a+=3Da > > from bringing the entire node to its knees. Obviously that will > eventually bomb with MemoryError, but I'd rather it be some time > *before* the poor computer starts thrashing virtual memory. To clarify: One node will be hosting multiple clients' code, and if it runs out of physical memory, performance for everyone else will be severely impacted. So I'm hoping to restrict the script's ability to consume all of memory, without (preferably) ulimit/rlimiting the entire process (which does other things as well). But if it can't be, it can't be. Chris Angelico