Memory allocation

Batista, Facundo FBatista at uniFON.com.ar
Mon Sep 22 16:49:02 EDT 2003


#- Knowing how much memory the object consumes will not help you with
#- that, at least in general.  The object could easily be changed in a
#- dozen ways yet still consume the same amount of memory.

No, sorry. Knowing how much memory consumes, gives me if it's a viable
solution.


#- Can't the object just track changes to itself?  This is a fairly 
#- common solution to the general problem you describe.  Resorting to
#- things like checking memory consumption is not likely the best way
#- to approach this.

Thought this. But gives me an API not separated from my main code (I have to
subclass each class from another one).


#- > but it still remains a general question: the other
#- > day I wanted to know "how much more expensive in memory is 
#- a list than a
#- > tuple for a given content".
#- 
#- I believe the answer was given, but in case it wasn't: they take 
#- effectively the same amount of memory, as each is basically a series
#- of pointers to other objects.

That's OK.

But, there is a way to know the memory consumption?





More information about the Python-list mailing list