sizeof?

Bjorn Pettersen bjorn at roguewave.com
Tue Oct 10 14:10:20 EDT 2000


On a related topic, is there a way to find out how much memory is being
used at any given time (from Python). It could be potentially useful for
performance optimizations...

-- bjorn

Remco Gerlich wrote:
> 
> seung-won hwang <shwang5 at students.uiuc.edu> wrote in comp.lang.python:
> > Is there any operator to measure the size of the object in Python
> > something like sizeof in C? I couldn't find any from the book
> > and documents I have. Thanks!
> 
> There is no way to find the exact number of memory bytes an object uses.
> Consider that irrelevant.
> 
> To find the length of a list, or a tuple, or other sequences, use len().
> 
> Remco Gerlich
> --
> http://www.python.org/mailman/listinfo/python-list




More information about the Python-list mailing list