[Python-Dev] Python GC/type()/weakref mystery (original) (raw)

Kevin Jacobs jacobs at theopalgroup.com
Thu Mar 18 13:30:34 EST 2004


Aahz wrote:

On Thu, Mar 18, 2004, Kevin Jacobs wrote:

Please read over my original mail again, since the magnitude of weirdness may not have been obvious the first time through.

Hmmmm... First of all, not all. When I tried your test with N=1, I did still get one leaked ref. I tried running with an extra gc.collect() at the end of each run, and that didn't help. I've verified that gc.collect() immediately after the running testfunc() does reap a bunch of stuff. And I've verified that the sum of len(gc.getobjects()) for each run equals that of running it at the start and end of the whole program. I'll let someone else who can look at the C code take over....

Thanks for double-checking that I'm not just hallucinating all of this.
I too will start looking into the C code, though I tend to avoid the GC and weakref subsystems at all costs. Others who know the GC process better (hint: Tim) are warmly invited to accompany me.

Thanks, -Kevin



More information about the Python-Dev mailing list