[Zope] Memory leak possibly solved

Chris Muldrow cmuldrow@fredericksburg.com
Mon, 27 Jan 2003 18:37:10 -0500


We've been fighting a rather nasty memory leak that was growing our memory
usage up to the 800 meg range or more and never giving any memory back. It
started when we switched to 2.6.0 (of course, we didn't notice until after
our 2.6.0 testing period...) and occurred as well with 2.6.1b1. Through a
whole lot of testing, I narrowed it down to when Zclass instances we have
that are CatalogAware were being indexed (mainly TextIndexed). I could start
up an instance of our site, hit the index button and watch the memory climb.
It did the same thing on a smaller scale when the individual instances were
saved and indexed. 
I tried rebasing the Zclasses; using both ZCTextIndex and TextIndex; running
on a standalone Zope instead of ZEO; and creating entirely new catalogs with
reduced numbers of indexes. Nothing seemed to work.
While doing this work on 2.6.1b1, I noticed that there was a bug that wasn't
letting me create a new Zclass in the 2.6.1b1 Products folder. I posted it
to the collector (I could add them in 2.6.0, then move the data to 2.6.1b1
and not be able to add them, so I figured it was some sort of weird bug).
Tres suggested I install the latest CVS version and see if it fixed the
Zclass problem.
It did fix the Zclass problem, and on a whim I threw my data into the CVS
install and started banging on the Catalog. It looks like the memory leak is
gone!!!! 
After dancing naked around the office for a little while, I decided to post
this for anyone else who might experience one of these two problems.
Because Tres and I both tried just the CVS Zclass stuff and it didn't fix
the problem, he said he thought it might be ZODB-related. I suspect that
might be the same issue with my Catalog problems--I pretty much had them
pinned down to writes into the ZODB.
Thanks to Chris and Dieter and Tres and anyone else who tried to help. I've
decided memory leaks are evil things born of Satan's womb....

Chris muldrow@mac.com