I don't get why there is a problem. I did a scan of the latest trunk and did 
not find a __del__ function anywhere.

If the sample code is run with the __del__ it accumulates memory rapidly.

Comment out the __del__ method which does nothing in this example and the 
memory accumulation is no longer there.

So would it not be sufficient to warn people using the framework about using 
the __del__ method in their own classes?

The Python advice I have found says to avoid if possible using __del__ and 
clean up resources with try:...finally:.. or wrap the resource in a with, of 
course that advice is Python revision dependent. The presence of the __del__ 
class method and a circular reference forces the garbage collector to place 
it on the uncollectable list unless it can prove there are no outside 
references.

My apologies if I missed something, I just would like to clearly understand. 
I write programs that live for months at a time and so far other than some 
initial working space expansion, which I don't classify as a leak, I have 
not had memory leak problems.

Thanks,
Ron

Reply via email to