Maybe one possibility is if your code has classes with a __del__ method in 
them, Massimo would have better perspective on if this is a possibility. If 
a class with this method is involved in a circular reference the garbage 
collector cannot clean it up because of uncertainty of execution of the 
__del__ method. This was discussed a lot on the group a few months back. I 
believe exec also has to be involved. Do a search for __del__ in the group 
to see what was said. There were also some tools mentioned in those threads 
that help with tracking down this sort of problem.

I find in Python as soon as a file variable binding produced by open goes 
out of scope it is closed, you don't have to specifically call close on it. 
Normally objects are dropped as soon as the reference count reaches 0. The 
garbage collector was added to clean up the circular referenced objects that 
will never get a count down to 0 without some outside help. It searches the 
heap looking for objects that have no references except other objects also 
in the garbage and marks those as candidates to clean out. The fact that 
these file objects are piling up means something is holding the file 
reference which also cannot be cleaned up.

Are you running on Linux? If so the /proc/pid_of_web2py/fd directory using 
ls -l will show you what files by name are open to the process which might 
provide some clues to which part of your code.

Reply via email to