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


Groups > comp.lang.python > #30128

Re: Memory usage per top 10x usage per heapy

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <junkshops@gmail.com>
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; 'url:pypi': 0.03; 'context': 0.05; '__init__': 0.09; 'happens.': 0.09; 'referenced': 0.09; 'worse': 0.09; 'cc:addr:python-list': 0.10; 'slightly': 0.15; '__slots__': 0.16; 'benjamin': 0.16; 'cc:name:python list': 0.16; 'disaster.': 0.16; 'fine.': 0.16; 'lambda': 0.16; 'subject:usage': 0.16; 'string': 0.17; 'wrote:': 0.17; 'string,': 0.17; "i'd": 0.22; 'cheers,': 0.23; 'cc:2**0': 0.23; 'originally': 0.23; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'replace': 0.27; 'interface': 0.27; "doesn't": 0.28; 'subject:per': 0.29; 'objects': 0.29; 'class': 0.29; "i'm": 0.29; 'function': 0.30; 'expect': 0.31; 'code': 0.31; 'url:python': 0.32; 'received:209.85.160.46': 0.32; 'could': 0.32; "can't": 0.34; 'received:google.com': 0.34; 'wrong': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'message- id:@gmail.com': 0.36; 'wanted': 0.36; 'url:org': 0.36; "didn't": 0.36; 'anything': 0.36; "i'll": 0.36; 'keeps': 0.37; 'does': 0.37; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'some': 0.38; 'sure': 0.38; 'header:Received:5': 0.40; 'between': 0.63; 'worth': 0.63; 'information': 0.63; 'alive.': 0.65; 'oscar': 0.84; 'overhead,': 0.84; 'severe.': 0.84; 'by.': 0.91; 'graphical': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=mvLRfjErwNw6OhFXvTvD4Bwo26zb0u65N5Hoousd+kM=; b=t+Ms2Wgd6S9IwSrczXbKAiWJ297FxXNpedp+L+4iUcUAfRLQUDCIeJxKyTtWYAEjJr N+UKdxgn+FxnMchxqHJbKfQLsLSkAZ0m5bK8IUicYEL85LKsp2h7bssiOPv6N/SVOZ8R AYX5I3Knhk/deGgysqGGB45wkLrJExm7t/OZAK1EkXVV3PusolKb4sNT6Nv2TfhUVD5k pkuKcKMNvrBXMAgqrLChFPrzYiNiDpm3FKJpDEqKD2y+xW1oiaYhQzcdHFTv1AGJhEjp BH6H4R60jYMFwCwLpU6u3sLSRF7HE7x89tqHXySjpLVAwXllTtFgAp1/PLfusXfTfcx+ /eaA==
Date Tue, 25 Sep 2012 14:35:28 -0700
From Junkshops <junkshops@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0
MIME-Version 1.0
To Oscar Benjamin <oscar.j.benjamin@gmail.com>
Subject Re: Memory usage per top 10x usage per heapy
References <983c532f-3ff6-4bd2-bb48-07cf4d065a4b@googlegroups.com> <5060EB2C.6080508@tim.thechases.com> <5060F3BB.7010706@gmail.com> <CAHVvXxTOZzjv__r-TgOUdJNnYBuAUUc-yKRPvQF82XQocNr9pQ@mail.gmail.com> <5061F31D.3020207@gmail.com> <CAHVvXxQfAMiPaHp0SDtfLknmK2nQUqaZBc83_LuE9nTHcHyerg@mail.gmail.com> <5062135F.5010400@gmail.com> <CAHVvXxTEiKP93-0+q1f4x9oWzf7rT43JAgw6DpZu993o_kdgbw@mail.gmail.com>
In-Reply-To <CAHVvXxTEiKP93-0+q1f4x9oWzf7rT43JAgw6DpZu993o_kdgbw@mail.gmail.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Cc Python List <python-list@python.org>
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.1379.1348608941.27098.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1348608941 news.xs4all.nl 6934 [2001:888:2000:d::a6]:44075
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:30128

Show key headers only | View raw


On 9/25/2012 2:17 PM, Oscar Benjamin wrote:
> I don't know whether it would be better or worse but it might be worth 
> seeing what happens if you replace the FileContext objects with tuples.
I originally used a string, and it was slightly better since you don't 
have the object overhead, but I wanted to code to an interface for the 
context information so started a Context abstract class that FileContext 
inherits from (both have __slots__ set). Using an object without 
__slots__ set was a disaster. However, the difference between a string 
and an object with __slots__ isn't severe.

>
> I can't see anything wrong with that but then I'm not sure if the 
> lambda function always keeps its frame alive. If there's only that one 
> line in the __init__ function then I'd expect it to be fine.

That's it, I'm afraid.

>
> Perhaps you could see what objgraph comes up with:
> http://pypi.python.org/pypi/objgraph
>
> So far as I know objgraph doesn't tell you how big objects are but it 
> does give a nice graphical representation of which objects are alive 
> and which other objects they are referenced by. You might find that 
> some other object is kept alive that you didn't expect.
>
I'll give it a shot and see what happens.

Cheers, MrsEntity

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


Thread

Memory usage per top 10x usage per heapy MrsEntity <junkshops@gmail.com> - 2012-09-24 14:59 -0700
  Re: Memory usage per top 10x usage per heapy Tim Chase <python.list@tim.thechases.com> - 2012-09-24 18:22 -0500
  Re: Memory usage per top 10x usage per heapy Junkshops <junkshops@gmail.com> - 2012-09-24 16:58 -0700
    Re: Memory usage per top 10x usage per heapy bryanjugglercryptographer@yahoo.com - 2012-09-27 01:00 -0700
    Re: Memory usage per top 10x usage per heapy bryanjugglercryptographer@yahoo.com - 2012-09-27 01:00 -0700
  Re: Memory usage per top 10x usage per heapy Dave Angel <d@davea.name> - 2012-09-24 21:14 -0400
  Re: Memory usage per top 10x usage per heapy Junkshops <junkshops@gmail.com> - 2012-09-24 21:21 -0700
  Re: Memory usage per top 10x usage per heapy Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-09-25 00:41 -0400
  Re: Memory usage per top 10x usage per heapy Tim Chase <python.list@tim.thechases.com> - 2012-09-25 05:51 -0500
  Re: Memory usage per top 10x usage per heapy Dave Angel <d@davea.name> - 2012-09-25 07:06 -0400
  Re: Memory usage per top 10x usage per heapy Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-25 12:10 +0100
  Re: gracious responses (was: Memory usage per top 10x usage per heapy) Tim Chase <python.list@tim.thechases.com> - 2012-09-25 06:40 -0500
    Re: gracious responses (was: Memory usage per top 10x usage per heapy) alex23 <wuwei23@gmail.com> - 2012-09-25 05:44 -0700
      Re: gracious responses Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-25 13:53 +0100
  Re: gracious responses Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-09-25 12:54 +0100
    Re: gracious responses Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-09-25 15:17 +0000
  Re: Memory usage per top 10x usage per heapy Dave Angel <d@davea.name> - 2012-09-25 14:50 -0400
  Re: Memory usage per top 10x usage per heapy Junkshops <junkshops@gmail.com> - 2012-09-25 14:02 -0700
  Re: Memory usage per top 10x usage per heapy Junkshops <junkshops@gmail.com> - 2012-09-25 14:35 -0700
  Re: Memory usage per top 10x usage per heapy Tim Chase <python.list@tim.thechases.com> - 2012-09-25 17:10 -0500
  Re: Memory usage per top 10x usage per heapy Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-25 16:09 -0600
  Re: Memory usage per top 10x usage per heapy Tim Chase <python.list@tim.thechases.com> - 2012-09-25 18:35 -0500

csiph-web