Path: csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!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.091 X-Spam-Evidence: '*H*': 0.82; '*S*': 0.00; 'cest': 0.09; 'cc:addr :python-list': 0.11; 'random': 0.14; '"ed"': 0.16; '-tkc': 0.16; 'bit.': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'grep': 0.16; 'jumps': 0.16; 'specifying': 0.16; 'threshold': 0.16; 'url:unix': 0.16; 'wrote:': 0.18; 'file,': 0.19; 'memory': 0.22; 'cc:addr:python.org': 0.22; 'either.': 0.24; 'space.': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'appear': 0.29; '(this': 0.29; '[1]': 0.29; "doesn't": 0.30; 'file': 0.32; 'another': 0.32; 'linux': 0.33; 'something': 0.35; 'test': 0.35; 'really': 0.36; 'charset:us-ascii': 0.36; 'possible': 0.36; 'should': 0.36; 'received:10': 0.37; 'window': 0.38; 'issue': 0.38; 'dave': 0.60; 'entire': 0.61; 'times': 0.62; "you've": 0.63; 'received:46': 0.66; 'between': 0.67; 'bottom': 0.67; 'exceed': 0.68; 'default': 0.69; 'saving': 0.69; 'repeat': 0.74; 'friend': 0.79; '2015': 0.84; 'freebsd': 0.84; 'top.': 0.84; '2-5': 0.91; 'doubling': 0.91; 'time)': 0.91 X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-Sender-Id: wwwh|x-authuser|tim@thechases.com X-MC-Relay: Neutral X-MailChannels-SenderId: wwwh|x-authuser|tim@thechases.com X-MailChannels-Auth-Id: wwwh X-MC-Loop-Signature: 1430430050393:1802576588 X-MC-Ingress-Time: 1430430050393 Date: Thu, 30 Apr 2015 16:41:37 -0500 From: Tim Chase To: Cecil Westerhof Cc: python-list@python.org Subject: Re: l = range(int(1E9)) In-Reply-To: <87zj5ps73z.fsf@Equus.decebal.nl> References: <87k2wtvbx1.fsf@Equus.decebal.nl> <87zj5ps73z.fsf@Equus.decebal.nl> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AuthUser: tim@thechases.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 50 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430430673 news.xs4all.nl 2855 [2001:888:2000:d::a6]:36317 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89677 On 2015-04-30 22:18, Cecil Westerhof wrote: > Op Thursday 30 Apr 2015 20:59 CEST schreef Dave Angel: >> ulimit is your friend if you've got a program that wants to gobble >> up all of swap space. > > Yes, my system is openSUSE 64 bit. I really should look into ulimit. > The default is: [snip] > max memory size (kbytes, -m) unlimited Note that AFAIK, "ulimit -m" doesn't work on Linux http://unix.stackexchange.com/questions/129587/does-ulimit-m-not-work-on-modern-linux Based on some quick testing[1], it doesn't appear to work on OpenBSD or FreeBSD either. -tkc [1] My test was to perform the following: 1) seq 20 > data.txt # to generate some random date 2) ed data.txt 3) find the PID of the "ed" process from another window using "ps ax | grep ed" 4) make note of the current memory used for that PID using "top -p $PID" 5) issue ",t$" in ed until the memory-used jumps up in the "top" window (this copies the entire file to the bottom of the file, doubling the size each time) 6) quit ed without saving ("Q") 7) issue "ulimit -m", specifying a threshold between the before-the-memory-jump and after-the-memory-jump values 8) repeat steps 2-5 until the memory jumps up in top. Notice that it's possible to do this multiple times and exceed the "ulimit -m" threshold, something the ulimit should prevent. .