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


Groups > comp.lang.python > #2759

Re: Sandboxed Python: memory limits?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.szaf.org!news.gnuher.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail
From "Martin v. Loewis" <martin@v.loewis.de>
Newsgroups comp.lang.python
Subject Re: Sandboxed Python: memory limits?
Date Thu, 07 Apr 2011 10:01:39 +0200
Organization 1&1 Internet AG
Lines 21
Message-ID <4D9D6F63.9080004@v.loewis.de> (permalink)
References <mailman.62.1302055157.9059.python-list@python.org> <inij0j$v6v$1@online.de> <mailman.91.1302134778.9059.python-list@python.org>
NNTP-Posting-Host port-92-206-213-187.dynamic.qsc.de
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding 7bit
X-Trace online.de 1302163299 9124 92.206.213.187 (7 Apr 2011 08:01:39 GMT)
X-Complaints-To abuse@einsundeins.com
NNTP-Posting-Date Thu, 7 Apr 2011 08:01:39 +0000 (UTC)
Cc python-list@python.org
To Chris Angelico <rosuav@gmail.com>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110307 Icedove/3.0.11
In-Reply-To <mailman.91.1302134778.9059.python-list@python.org>
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:2759

Show key headers only | View raw


Am 07.04.2011 02:06, schrieb Chris Angelico:
> On Thu, Apr 7, 2011 at 6:38 AM, Martin v. Loewis <martin@v.loewis.de> wrote:
>> You can adjust the implementations of PyMem_Malloc and PyObject_Malloc.
>> This would catch many allocations, but not all of them. If you adjust
>> PyMem_MALLOC instead of PyMem_Malloc, you catch even more allocations -
>> but extensions modules which directly call malloc() still would bypass
>> this accounting.
> 
> 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='a'
> while True:
>     a+=a

That would certainly be caught by instrumenting PyObject_MALLOC. More
generally, I believe that if you instrument the functions I mentioned,
your use case is likely covered.

Regards,
Martin

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


Thread

Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-06 11:59 +1000
  Re: Sandboxed Python: memory limits? "Martin v. Loewis" <martin@v.loewis.de> - 2011-04-06 22:38 +0200
    Re: Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-07 10:06 +1000
      Re: Sandboxed Python: memory limits? "Martin v. Loewis" <martin@v.loewis.de> - 2011-04-07 10:01 +0200
      Re: Sandboxed Python: memory limits? "Martin v. Loewis" <martin@v.loewis.de> - 2011-04-07 10:01 +0200
    Re: Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-07 10:10 +1000
      Re: Sandboxed Python: memory limits? David Bolen <db3l.net@gmail.com> - 2011-04-07 14:36 -0400
        Re: Sandboxed Python: memory limits? Chris Angelico <rosuav@gmail.com> - 2011-04-08 04:59 +1000

csiph-web