[Zope] Zope Eating Memory for Breakfast

Michel Pelletier michel@digicool.com
Thu, 13 Apr 2000 11:12:15 -0700


Hung Jung Lu wrote:
> 
> Aha! There is the first clue. The memory increase has to do
> with Zope ZODB operations.
> 
> Why does it have to do with ZODB operations?

I'm not certain how you conclude this, I don't see specific evidence
toward this.
 
> (1) There are Zope sites out there running for a long time and
> people aren't complaining about memory leak problems. These
> include some heavily-visited sites.

Exactly.
 
> (2) Everytime you restart Zope the memory usage starts out OK.
> 
> (3) The size of the problem is proportional to the size of
>     Data.fs

The size of the Data.fs file has no correlation to the amount of memory
consumption.
 
> 
> (5) But when I use Zope management interface to do some
> operations, like clicking on the Find tab (and then the
> Find button in that page), the memory usage jumped. I
> managed to raise the memory usage by 5 MB just by clicking
> the Find tab/button all over places and search for
> files containing a diverse text pattern.

This is because Find activated objects out of the database to see if
they match your criteria.  As it activates objects, it puts them in the
object cache.  The object cache holds up to N objects, not up to X
megabytes, so if you have large objects, your memory usage will go up
noticably.  Using Find tends to fill *up* the object cache.  After using
a find operation, your memory usage will go up.  But I bet if you keep
finding an finding and finding, it will not go up indefinatly. 
Increased memory usage does not neccesarily mean there is a leak, it
might just need that memory.
 
-Michel