[Zope] memory leak problems
Peter Bengtsson
mail@peterbe.com
Wed, 19 Dec 2001 18:35:35 +0100
> > I missed the beginning of this thread, but the memory / attributes
> > problem you describe was a problem in the original photo product, which
> > has been fixed in Ron Bickers' newer product.
>
> Indeed. If you're using Andrew's Photo product, this is most likely your
> problem. The old product stored photo data as string attributes. The new
> one uses Zope Image objects (or optionally ExtImage objects to store the
> data in the file system). See http://www.zope.org/Members/rbickers/Photo
I'll do that then! Definitly; just a matter of time :)
> As per what Dieter said, if all the attributes load on accessing the
> object, the entire image data would load from the old Photo product. This
> was the most significant reason I wrote the new product.
>
> I just ran your script on my set of 453 Photos, and there was zero increase
> in memory use.
Like Toby Dickenson pointed out, if you use any attribute of the object it
then takes up all that memory and in fact I do. I do not only use
objectValues(). I actually do something like this:
<firstly in one script>
for photo in context.tested_objectValues('Photo'):
<secondly in another>
filtered_list=[]
for photo in context.objectValues('Photos'):
if not hasattr(photo,'avoid'):
filtered_list.append(photo)
return filtered_list
> Note that if you're going to use ExtImage, I recommend getting the latest
> CVS version from SourceForge which includes several ExtImage fixes.
The renaming problem solved?