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

Date 2012-09-25 14:35 -0700
From Junkshops <junkshops@gmail.com>
Subject Re: Memory usage per top 10x usage per heapy
References (3 earlier) <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>
Newsgroups comp.lang.python
Message-ID <mailman.1379.1348608941.27098.python-list@python.org> (permalink)

Show all headers | 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