[Zope] Zope 2.7.3 Memory Leaks

Andy Yates andy at nnu.com
Wed Jan 5 16:30:43 EST 2005


> 
> You did this flushing and looking at the reference counts in
> a process that already had run for several days (and therefore was
quite
> huge)?
>
It took about 24 hours.
 
> 
> Do you use C extensions that create non-Python objects (and
> therefore do not have reference counts and show up in the list)?
> Maybe, such a C extension is leaking.
No we do not use C extensions.  In fact we can reproduce this behavior
on a fresh install.  On a fresh system create a python script that puts
data in a session object.

s = context.REQUEST.SESSION
t = ' ' * 1024
s['data'] = t
print "foo"
return printed

Then call this script with your favorite bench marking program.  We used
apache bench (ab).  This will cause python2.3 to consume all available
memory and crash or lockup.  The speed at which this happens depends on
the amount of data you assign to 't' and how fast you call the script.
The session timeout does not seem to affect the memory use.  We even
tried setting the session timeout to 1 minute.

In a very basic sense this is all our production server does.  When a
user first comes to our site we query a mysql database for several
hundred values.  These values are then stored in the session object as a
map.  All other pages are built dynamically based on the values stored
in the session object.  

Is the session object system just not supposed to be used like this?


> 
> Are your sessions huge?
> Usually, they are stored as pickles in RAM.
> If they were huge, some thousands of sessions might
> consume a considerable amount of RAM. You would not see
> them in the reference counts because Pickles are strings
> and you see only instances.
>  
> --
> Dieter

I would say they are less than 15K each.


Andy


More information about the Zope mailing list