[Python-Dev] funny leak
Tim Peters
tim.one@comcast.net
Mon, 24 Mar 2003 10:57:04 -0500
[Christian Tismer]
> No, this is not the point. Don't call the function
> at all, just execute the above code and call
> gc.collect(). You will see one reference eaten
> every time you repeat this.
Can you show explicit evidence instead of trying to describe it? Here's
what I tried:
def one():
def conjoin(gs):
def gen():
gs # unbreakable cycle
gen # unless one is commented out
import sys, gc
lastrc = 0
while 1:
one()
gc.collect()
thisrc = sys.gettotalrefcount()
print thisrc - lastrc,
lastrc = thisrc
Running that program under a debug-build CVS Python shows no growth in
sys.gettotalrefcount() after the first two iterations. It also displays no
process-size growth. IOW, I see no evidence of any flavor of leak.
I don't claim that you don't, but I don't know what "just execute the above
code ... one reference eaten every time" *means*. It can't mean executing
the specific program I pasted in above, because that simply doesn't eat a
reference each time.