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 serhiy.storchaka
Recipients amaury.forgeotdarc, loewis, pitrou, rhettinger, serhiy.storchaka
Date 2013-09-20.00:29:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1379636982.2.0.349469274303.issue19048@psf.upfronthosting.co.za>
In-reply-to
Content
Here is advanced function which counts only objects on which there are no external references.

>>> import itertools
>>> a, b = itertools.tee(range(10000))
>>> max(zip(a, range(100)))
(99, 99)
>>> sys.getsizeof(a)
32
>>> gettotalinnersizeof(a)
32
>>> gettotalinnersizeof(b)
292
>>> gettotalinnersizeof(a, b)
608

Total size of a and b is larger than a sum of sizes of a and b. It's because it includes size of one shared between a and teedataobject and one shared range iterator.
History
Date User Action Args
2013-09-20 00:29:42serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, rhettinger, amaury.forgeotdarc, pitrou
2013-09-20 00:29:42serhiy.storchakasetmessageid: <1379636982.2.0.349469274303.issue19048@psf.upfronthosting.co.za>
2013-09-20 00:29:42serhiy.storchakalinkissue19048 messages
2013-09-20 00:29:41serhiy.storchakacreate