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 mwh
Recipients
Date 2004-08-02.12:56:07
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=6656

I've finally worked out what's going on here.

It's because compiling the file interns the name of the file being 
compiled.  Now that interned strings are mortal, this isn't a big 
deal, but it still results in a string being added to and removed 
from the interned strings dictionary with net result (almost all of 
the time) of incrementing the refcount on 'dummy' by one.  Once 
in every thousand or so iterations this results in the interned 
string dictionary being resized and throwing all the references to 
dummy away, so this isn't a 'real' leak.

OTOH, I'd still like to do something about this (as is, test_pkg 
appears to leak 10 references per run because of this).  The 
simplest thing would be to just plain not intern the filename during 
compilation (I find it hard to believe that it's of any real 
benefit). The more invasive solution would be to not do 
refcounting on dummy (assuming that's even possible) which is a 
scarier change, but would stop similar problems with other tests (I 
have a feeling that test_pkgimport appears to be leaking 
references because of a different incarnation of the same 
problem).
History
Date User Action Args
2007-08-23 14:16:52adminlinkissue808596 messages
2007-08-23 14:16:52admincreate