[Python-Dev] We got leaks!
Tim Peters
tim@zope.com
Fri, 6 Dec 2002 22:27:10 -0500
[Kevin Jacobs]
> ...
> Attached is a patch for this leak and several others in cPickle.c
> ...
Thanks, Kevin! THe patch was spot-on and I checked it in (and marked as a
bugfix candidate since the same cPickle leaks appear to exist in 2.2.2).
I already backported the tp_slot_hash leak fix to the 2.2 maintenance
branch.
I checked in the leak-detector code to test_both.py, so this will be easier
to try the next time around.
The remaining leaks in the C implementation were my errors, in the date and
datetime pickle support functions.
There are no visible leaks remaining in the Python or C implementations of
the sandbox datetime code.
BTW, running hefty tests in a loop and staring at sys.gettotalrefcount()
each trip is, as I think this exercise demonstrated, a powerful leak
detector. I think we plugged about 10 slow leaks here, 8 of them
long-standing leaks in Python (of course, whether they're "slow" or "fast"
leaks depends on the app! for the test suite, they were slow).
Fun, fun <wink>.