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 <1501762491.94.0.0780356045867.issue31105@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2017-08-03 12:14:51serhiy.storchakasetrecipients: + serhiy.storchaka, arigo, pitrou
2017-08-03 12:14:51serhiy.storchakasetmessageid: <1501762491.94.0.0780356045867.issue31105@psf.upfronthosting.co.za>
2017-08-03 12:14:51serhiy.storchakalinkissue31105 messages
2017-08-03 12:14:51serhiy.storchakacreate