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 arigo, pitrou, serhiy.storchaka
Date 2017-08-03.12:14:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
There is an existing protocol for estimating the size of allocated memory. __sizeof__. Python API sys.getsizeof() and C API _PySys_GetSizeOf(). But it is too heavy for using in GC.

As a fast approximation the default implementation of the __sizeof__ method can be used:

    tp_basicsize + tp_itemsize * Py_SIZE(self)
Date User Action Args
2017-08-03 12:14:51serhiy.storchakasetrecipients: + serhiy.storchaka, arigo, pitrou
2017-08-03 12:14:51serhiy.storchakasetmessageid: <>
2017-08-03 12:14:51serhiy.storchakalinkissue31105 messages
2017-08-03 12:14:51serhiy.storchakacreate