[Zope] memory leak problems

Peter Bengtsson mail@peterbe.com
Tue, 18 Dec 2001 15:05:33 +0100


I have a Python Script that looks like this:

<id>latestphotos</id>
<params></params>
objects = []
for object in context.objectValues(['Folder','Photo']):
    if object.meta_type == 'Folder':
        objects = objects + object.latestphotos()
    else:
        objects.append(object)

return objects


This I run from a DTML Method like this:
<dtml-in "_.sequence.sort(latestphotos(), 
(('bobobase_modification_time',),))" reverse size=4 orphan=0>
  XXX ... XXX
</dtml-in>


The script crawls through a folder structure which contains Photo's and 
subfolders.
It returns a healthy list of about 400 Photo's (from the Photo product) which 
are all object referenses.
It works like it's supposed to, but the server leaks like hell when I run 
this. From about 5-10% of the memory to up to 50-70%!!
Having accidently triggered this script I have to restart the server.

Any ideas anyone why?
Other solutions?