[Zope] Zope 2.7.3 Memory Leaks

Andy Yates andy at nnu.com
Thu Dec 2 17:24:09 EST 2004


We recently upgraded from:
Zope Version (Zope 2.6.1 (source release, python 2.1, linux2), python
2.2.2, linux2) 
Python Version 2.2.2 (#1, Feb 24 2003, 19:13:11) [GCC 3.2.2 20030222
(Red Hat Linux 3.2.2-4)] 

To:
Zope Version (Zope 2.7.3-0, python 2.3.4, linux2) 
Python Version 2.3.4 (#1, Sep 14 2004, 10:22:31) [GCC 3.2.2 20030222
(Red Hat Linux 3.2.2-5)] 

Now it seems to leak memory (400+ Mb) to the point I have to restart
Zope every 3 days.

I've read that memory leaks are almost always caused by the programmer,
so I set up some very simple tests that did not involve existing code.

First I used ab to get a simple page template.  After running 1000s of
request the memory had climbed slowly and never went down.

Next I created an 8Mb page template.  This caused the memory usage to
climb much faster.  After the test the memory never goes back down.

I installed LeakFinder and started running more tests.

I used ab to get a python script that stored a 1k string in the session
object.  The transient object container timeout was set to 1 minute.
This also caused Zope to consume memory.  LeakFinder said the
Products.Transience.TransientObject.TransientObject ref count grew with
each request and never went down.  Everything else seemed to level off.
The debug output of Transience.py showed that the "buckets" seemed to be
getting deleted as expected, but the memory usage never goes down.  1
minute after the test stopped the transient object container showed that
there were no more items in the container.  It seems like when Zope
deletes expired sessions but contents of the sessions are not deleted.

Is anyone else seeing this behavior?  Is there a workaround or fix?

Thanks!
Andy Yates



More information about the Zope mailing list