Re: How to measure the memory cost in Python?

2009-05-03 Thread CTO
Alright, it's pretty obvious that I have a lot to learn before I'll be able to intelligently address this problem, but if somebody could point me at something that would help me figure out the terminology at least I'd really appreciate it. From what you're saying, it sounds like a combination of th

Re: How to measure the memory cost in Python?

2009-05-03 Thread Aahz
In article <7744f434-dd43-4010-ba25-90096f59d...@n7g2000prc.googlegroups.com>, CTO wrote: > >I will admit, I have *no idea* what that code is doing, but in looking >through the gc module documentation, I'm seeing the gc.get_objects >function. Would it be equivalent to what the OP is asking to tra

Re: How to measure the memory cost in Python?

2009-05-02 Thread CTO
> > PS) The asizeof(obj) function from this recipe > code.activestate.com/recipes/546530> does size the object plus its > > references, recursively. > > Correction, the last sentence should be: The asizeof(obj) ... plus its > referents, recursively. I will admit, I have *no idea* what that code i

Re: How to measure the memory cost in Python?

2009-05-01 Thread Jean
On May 1, 12:50 pm, Jean wrote: > On May 1, 10:56 am, CTO wrote: > > > > > > sys.getsizeof() [a suggested solution] isn't platform-specific. > > > So, to answer the OP's question, you'd just do something like > > > def get_totalsize(obj): > >         total_size = sys.getsizeof(obj) > >         fo

Re: How to measure the memory cost in Python?

2009-05-01 Thread Jean
On May 1, 10:56 am, CTO wrote: > > sys.getsizeof() [a suggested solution] isn't platform-specific. > > So, to answer the OP's question, you'd just do something like > > def get_totalsize(obj): >         total_size = sys.getsizeof(obj) >         for value in vars(obj).values(): >                 tr

Re: How to measure the memory cost in Python?

2009-05-01 Thread CTO
> sys.getsizeof() [a suggested solution] isn't platform-specific. So, to answer the OP's question, you'd just do something like def get_totalsize(obj): total_size = sys.getsizeof(obj) for value in vars(obj).values(): try: total_size += get_total_size(value)

Re: How to measure the memory cost in Python?

2009-05-01 Thread Jean
On May 1, 7:54 am, CTO wrote: > Not OP, but I'd actually like to know if there's an answer to this one > that doesn't involve platform-specific tools. Depending on what you need and the O/S you are using, this recipe may help That recipe also appe

Re: How to measure the memory cost in Python?

2009-05-01 Thread Chris Rebert
On Fri, May 1, 2009 at 7:54 AM, CTO wrote: > Not OP, but I'd actually like to know if there's an answer to this one > that doesn't involve platform-specific tools. sys.getsizeof() [a suggested solution] isn't platform-specific. Cheers, Chris -- http://blog.rebertia.com -- http://mail.python.org

Re: How to measure the memory cost in Python?

2009-05-01 Thread CTO
Not OP, but I'd actually like to know if there's an answer to this one that doesn't involve platform-specific tools. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to measure the memory cost in Python?

2009-05-01 Thread Chris Rebert
o help me? See Gabriel's answer in your other thread "Measure the memory cost in Python". And please don't post duplicate threads asking essentially the same question, especially when you were given a perfectly acceptable answer and not that much time has past since you start

How to measure the memory cost in Python?

2009-05-01 Thread Li Wang
Hi everyone: I want to measure the actual memory cost of a particular step in my program (Python program), does anyone know if there is some function in Python could help me to do this job? Or should I seek other tools to help me? Thank you very much! -- Li -- Time is all we have and you ma

Re: Measure the memory cost in Python

2009-04-30 Thread Gabriel Genellina
En Thu, 30 Apr 2009 08:00:07 -0300, Li Wang escribió: I want to measure the actual memory cost of a particular step in my program (Python program), does anyone know if there is some function in Python could help me to do this job? Or should I seek other tools to help me? It's hard to comp

Measure the memory cost in Python

2009-04-30 Thread Li Wang
Hi everyone: I want to measure the actual memory cost of a particular step in my program (Python program), does anyone know if there is some function in Python could help me to do this job? Or should I seek other tools to help me? Thank you very much! -- Li -- Time is all we have and you m