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 benjamin.peterson, hynek, loewis, pitrou, serhiy.storchaka, stutzbach
Date 2012-07-30.08:14:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
> For the PyAccu, AFAICT, objects cannot leak out of it (except for gc.getobjects in debug mode).

Not only in debug mode.

>>> import io, gc
>>> s=io.StringIO()
>>> s.write('12345')
>>> s.write('qwerty')
>>> for o in gc.get_objects():
...     if "'123" in repr(o) and len(repr(o)) < 1000:
...         print(type(o), repr(o))
<class 'list'> ['12345', 'qwerty']
<class 'list'> ['o', 'gc', 'get_objects', 'repr', 'o', "'123", 1000, 'len', 'repr', 'o', 'print', 'type', 'o', 'repr', 'o']
<class 'tuple'> ("'123", 1000, None)

Someone can summarize sys.getsizeof() for all managed by GC objects and therefore count internal objects twice.

I think the standard library should provide a method for recursive calculation of memory (in some sense, perhaps using different strategies), but that should wait up to 3.4. __sizeof__ should count non-object memory that is not available for GC. As I understand it.
Date User Action Args
2012-07-30 08:14:11serhiy.storchakasetrecipients: + serhiy.storchaka, loewis, pitrou, benjamin.peterson, stutzbach, hynek
2012-07-30 08:14:11serhiy.storchakasetmessageid: <>
2012-07-30 08:14:11serhiy.storchakalinkissue15490 messages
2012-07-30 08:14:10serhiy.storchakacreate