Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42365

Re: Why does 1**2**3**4**5 raise a MemoryError?

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.057
X-Spam-Evidence '*H*': 0.89; '*S*': 0.00; 'exception.': 0.09; 'subject:Why': 0.09; 'bug': 0.12; "wouldn't": 0.14; 'operation,': 0.16; 'received:74.208.4.195': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'typing': 0.19; 'memory': 0.22; 'header:User-Agent:1': 0.23; 'least': 0.26; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; "i'm": 0.30; 'cap': 0.31; 'ok.': 0.31; 'there.': 0.32; 'probably': 0.32; "we're": 0.32; 'run': 0.32; 'open': 0.33; 'linux': 0.33; 'sense': 0.34; 'maybe': 0.34; 'but': 0.35; 'there': 0.35; 'ubuntu': 0.36; 'doing': 0.36; 'possible': 0.36; 'subject:?': 0.36; 'should': 0.36; 'application': 0.37; 'operating': 0.37; 'to:addr:python-list': 0.38; 'itself': 0.39; 'to:addr:python.org': 0.39; 'tell': 0.60; 'more': 0.64; 'received:74.208': 0.68; 'allocation': 0.74; 'fails,': 0.84; 'besides,': 0.93
Date Sun, 31 Mar 2013 08:43:10 -0400
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130308 Thunderbird/17.0.4
MIME-Version 1.0
To python-list@python.org
Subject Re: Why does 1**2**3**4**5 raise a MemoryError?
References <8e43bc87-e822-4bb3-b9ef-ccd489da8bf3@googlegroups.com> <5157e6cc$0$29974$c3e8da3$5496439d@news.astraweb.com> <8276eff6-9e5c-4060-b9e8-94fab606206f@googlegroups.com>
In-Reply-To <8276eff6-9e5c-4060-b9e8-94fab606206f@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:Zt8P8+ItZT2IHGw7BvPmpsqMlDQGyMW9PDhKA7g0dG6 pkKPQK+OcEr6PCUHANIe47gnbZ9T0xEjclevM62a4+4aJbeJba XinGGYfNBn6mF6SdPf0G9YWYTuPCf6aI83ChlFiNlojefBMreP bJ7tCGdptZtPWhS6j66b2dYUeCMtm43KHG24xk0KRTFyLQK+aY jR8ff3xOKrO4k6V2VAFdI0H53L811kPdcNMWJwNFlWN16gA0Lu B4MVPGynqPrGczKqXPSdxApqCx+E8tzFP9iQznpDrpjUhvc4lx 0F0a3ZWjY2TIgLoUWaK8vbR5I+CvzlnZoZMiBV/unqTmeqKqg= =
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.4012.1364733818.2939.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1364733818 news.xs4all.nl 6920 [2001:888:2000:d::a6]:49870
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:42365

Show key headers only | View raw


On 03/31/2013 08:07 AM, morphex wrote:
> Aha, OK.  Thought I found a bug but yeah that makes sense ;)
>
> While we're on the subject, wouldn't it be nice to have some cap there so that it isn't possible to more or less block the system with large exponentiation?
>

There's an assumption there.  The Operating System should defend itself 
against starvation by any single process.

Besides, there are many ways for a process to run out of memory, and 
exponentiation is probably the least likely of them.  In general, an 
application cannot tell whether a particular memory allocation will 
succeed or not without actually trying the allocation.  If it fails, you 
get the exception.

I'm typing this while a terminal is open doing the particular operation, 
and the system doesn't seem in the least sluggish.

Currently the memory used is at 10gig, and while there are some pauses 
in my typing, the system has not died.  This is on Linux Ubuntu 12.04.

At 15gig, there are some blockages, of maybe 5 secs each.

-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Why does 1**2**3**4**5 raise a MemoryError? morphex <morphex@gmail.com> - 2013-03-30 23:56 -0700
  Re: Why does 1**2**3**4**5 raise a MemoryError? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-03-31 07:33 +0000
    Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <davea@davea.name> - 2013-03-31 03:48 -0400
    Re: Why does 1**2**3**4**5 raise a MemoryError? morphex <morphex@gmail.com> - 2013-03-31 05:07 -0700
      Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <d@davea.name> - 2013-03-31 08:43 -0400
        Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-03-31 09:15 -0400
          Re: Why does 1**2**3**4**5 raise a MemoryError? Jason Swails <jason.swails@gmail.com> - 2013-03-31 10:03 -0400
      Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-03-31 09:04 -0400
      Re: Why does 1**2**3**4**5 raise a MemoryError? Tim Roberts <timr@probo.com> - 2013-04-01 21:45 -0700
        Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-02 17:16 +1100
        Re: Why does 1**2**3**4**5 raise a MemoryError? Dan Sommers <dan@tombstonezero.net> - 2013-04-02 12:56 +0000
    Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-03-31 08:59 -0400
  Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <davea@davea.name> - 2013-03-31 03:34 -0400
    Re: Why does 1**2**3**4**5 raise a MemoryError? "Alex" <foo@email.invalid> - 2013-03-31 22:06 +0000
      Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-01 09:28 +1100
        Re: Why does 1**2**3**4**5 raise a MemoryError? "Alex" <foo@email.invalid> - 2013-04-01 00:39 +0000
          Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-01 11:58 +1100
          Re: Why does 1**2**3**4**5 raise a MemoryError? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-04-01 04:16 +0000
            Re: Why does 1**2**3**4**5 raise a MemoryError? Roy Smith <roy@panix.com> - 2013-04-01 07:48 -0400
          Re: Why does 1**2**3**4**5 raise a MemoryError? Nobody <nobody@nowhere.com> - 2013-04-02 08:40 +0100
      Re: Why does 1**2**3**4**5 raise a MemoryError? Chris Angelico <rosuav@gmail.com> - 2013-04-01 09:32 +1100
      Re: Why does 1**2**3**4**5 raise a MemoryError? Dave Angel <davea@davea.name> - 2013-03-31 18:34 -0400

csiph-web