[Python-Dev] refleak hunting fun!

Brett C. bac at OCF.Berkeley.EDU
Thu Aug 14 22:21:19 EDT 2003

Mark Hammond wrote:

>><Brett's potentially ignorant newbie questions follow>
>>Is there any reason not to add Michael's code to regrtest.py (or at
>>least get it to the point of where it could be added)?
>>Finding leaks as
>>part of running a test would be nice.  We could even have a set in
>>regrtest.py that stored tests known to throw the test off (because of
>>caching or whatever).  Obviously testing would be option that
>>is off by
> I added some reference count leak tests to the pyxpcom test suite.  The
> general strategy was to run a test once, count the references, then run the
> tests n (for a large n) more times.  The first run before starting to count
> reduces the effect of caches.  Then only a "few" leaked references is likely
> to be related to the environment, whereas >n leaked references is likely to
> be a real leak.
> It seems to be working fairly well, and trapped a number of old and new
> leaks.

Sounds good.  Could make the value of n part of the command-line option. 
  Any interest of adding them to regrtest.py?


More information about the Python-Dev mailing list