This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author loewis
Recipients georg.brandl, loewis, schuppenies
Date 2008-05-17.13:46:44
SpamBayes Score 0.041469432
Marked as misclassified No
Message-id <>
It's actually not possible, in general, to compute the memory
consumption of an object using basicsize and itemsize. An example is the
dictionary, where there is no way to find out how many slots are
currently allocated.

Even for the things such as lists where the formula
basicsize+len*itemsize would be correct it may fail, e.g. a list reports
its itemsize as zero, even though each list item consumes four bytes (on
a 32-bit system).

I don't really see a problem with calling it sizeof, so I would then
propose sys.sizeof as the appropriate location.
Date User Action Args
2008-05-17 13:46:50loewissetspambayes_score: 0.0414694 -> 0.041469432
recipients: + loewis, georg.brandl, schuppenies
2008-05-17 13:46:50loewissetspambayes_score: 0.0414694 -> 0.0414694
messageid: <>
2008-05-17 13:46:48loewislinkissue2898 messages
2008-05-17 13:46:46loewiscreate