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 arigo, brett.cannon, docs@python, fijall, loewis, lukasz.langa, pitrou
Date 2011-02-04.09:42:09
SpamBayes Score 1.63791e-09
Marked as misclassified No
Message-id <>
I can propose a specification of getsizeof: if you somehow manage to traverse all objects (without considering an object twice), and sum up the getsizeof results, you should end up with something close to, but smaller than the actual memory consumption. How close is a quality-of-implementation issue (so always returning 0 would be correct-but-useless).

It may be that implementations can also support counting certain hidden memory usage (headers, blocks shared across instances that are not objects themselves). Such functions would should have different names and interfaces (e.g. sys.gethiddenblocks(o) may return a list of (address, size) pairs); CPython doesn't provide any such function (although sys.mallocoverhead might be useful).

In any case: I'm not convinced that it is useful to mark functions as CPython-specific in the documentation. This clutters the documentation, and is of interest only for language lawyers. So if implementation details are to be documented, I'd prefer this to happen in a separate document.
Date User Action Args
2011-02-04 09:42:10loewissetrecipients: + loewis, brett.cannon, arigo, pitrou, docs@python, lukasz.langa, fijall
2011-02-04 09:42:10loewissetmessageid: <>
2011-02-04 09:42:09loewislinkissue10994 messages
2011-02-04 09:42:09loewiscreate