[Zope] Memory leak

Mark Thomas markt@kooee.com.au
Tue, 04 Feb 2003 12:42:31 +1100


I'm having some pretty severe problems with memory leaks, where the 
memory usage on my server is growing rapidly, then crashing Zope (every 
2 days or so).

When Zope crashes, it often restarts itself which isn't too bad if this 
was all that is required to get all services up and running again.  
However, I have to manually re-create a 'transient object container' in 
the temp_folder every time Zope is restarted.  Also, when Zope goes down 
(or the memory is all taken up) it often takes out other services which 
don't automatically restart, such as ssh, telnet, mail etc.  Obviously, 
the real answer is to stop the memory leak in the first place, so that 
Zope never has to be restarted.

I'm running Python 2.1.3 and Zope 2.6.0 and I've read and followed much 
of the advice given on this mailing list re: memory leaks.  For 
instance, I've set ZOPE_SECURITY_POLICY=3DPYTHON in my Zope startup 
script and checked the reference counts for various things, but can't 
spot anything that might be a problem.  I also saw a 'memory leak 
possible solved' message which talked about indexing catalogs as being a 
problem.  However, this didn't solve my problem.

In my python scripts I often use request.set and session.set commands, 
and I read that they may be causing problems.  I use these functions to 
pass variables between python scripts and dtml methods or other python 
scripts.  I sort of understand why using these functions may be a 
problem - because there is nothing to clean them up once sessions are 
closed?  What is the better way to pass variables around?

Any help would be greatly appreciated, the mailing list seems to be 
running out of ideas on this topic.
Thanks in advance.