[Python-Dev] refleak hunting fun!
Mark Hammond
mhammond at skippinet.com.au
Fri Aug 15 15:05:52 EDT 2003
> <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.
Mark.
More information about the Python-Dev
mailing list