[Zope] Sessions and RAM cache managers causing memory leak

Richard Ettema richard.ettema at yoursolutions.com
Mon May 17 05:34:03 EDT 2004


Hi,

I have a website using CMF that uses sessions and a couple of RAM Cache 
Managers. There seems to be some problem between them and the data I am 
storing that is causing a huge memory leak (At times 300-400M of memory 
is chewed up in 10 minutes).

My problem is how to track the problem down. I thought it would be 
simple process of running httperf and including/excluding things until I 
narrow it down. It hasn't been as simple as that, actually it has become 
very confusing...

Zope Version: 2.6
Python: 2.1.3
CMF: 1.4.2

The session objects hold general data for the current user including; 
strings, lists, dictionaries and a datetime object.

There are 2 RAM Cache Managers, one which caches for 15 mins and one for 
24 hours. Both cache 20-30 DTML Methods or Python Scripts that return 
either lists, datetime objects, dictioneries, or rendered dtml. Some of 
the dtml calls the catalog multiple times, I can't see why, but would 
this be a problem? (I also tried changing everything to strings to see 
if it was a problem with caching objects like datetime and dictionaries, 
but no change)

I created a test dtml method that creates a simple session (with a 
single string stored), and also calls all the methods/scripts that are 
cached. I then went about adding/removing these and running httperf to 
narrow down the problem. This is what happened calling the test method 
by httperf for approx 15 mins after restarting zope after each test 
(initial memory usage was 22M before running httperf)...

Calling all methods/scripts being cached (no sessions created):
86M used at end of test.

Calling the sessions only, creating a session for each call (no caching):
60M used at end of test.

Calling cached methods/scripts and session creation together (this is 
everything):
471M used at end of test (usually more).

Calling 15min cache objects and session creation (exclude 24hour cache 
objects):
192M used at end of test.

Calling 24hour cache objects and session creation (exclude 15min cache 
objects):
159M used at end of test.

I don't understand whats going on here. there seems no problem between 
the 2 RAM caches when you run them together. No problem with the session 
machinery when you create sessions by itself. but put everything 
together and it all goes very wrong!
I would have thought if the caching on its own ends up at 86M and the 
sessions on their own end at 60M, then together i should expect around 
140-150M.

Any ideas of where I should be looking, something I am overlooking, or 
any known problems with cmf,caching,sessions that I should be aware of?

Thanks for your help on this, as I have no idea where to go next.

Richard.




More information about the Zope mailing list