Nick Coghlan <ncogh...@gmail.com> added the comment:

I added some review comments to the patch, but I'm not sure how usable this is 
going to be in practice. References generally stay fairly stable while using 
the interactive interpreter, but the new block accounting jumps around all over 
the place due to the internal free lists (which *don't* count in for 
'gettotalrefcounts', but *do* count in the new block accounting). The following 
interpreter session has both this patch and the #13389 patch applied:

>>> a = sys.getallocedblocks()
[76652 refs, 21773 blocks]
>>> a
21779
[76652 refs, 21774 blocks]
>>> x = [None]*10000
[76652 refs, 21776 blocks]
>>> del x
[66650 refs, 21775 blocks]
>>> gc.collect(); gc.collect(); gc.collect()
0
0
0
[66650 refs, 21756 blocks]
>>> b = sys.getallocedblocks()
[66652 refs, 21772 blocks]
>>> b - a
-2
[66652 refs, 21772 blocks]

So, generally +1 on the idea, but I think we should hide at least the initial 
implementation behind PY_REF_DEBUG until we're sure we've worked the kinks out 
of it.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue13390>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to