[Zope] Investigating a reference leak...

Chris Withers chris at simplistix.co.uk
Fri Jan 28 02:39:57 EST 2005


Ben Last (Zope) wrote:
> 1) Is there a better place than __setcache__ to identify where references to Images are being created?  I don't fully understand the
> way in which persistent objects are actually created and populated.

Not sure you mean __setcache__, but this is the kind of question the 
good folks on zodb-dev at zope.org maybe be able to help with...

> 2) Our site is very dependent on ExternalMethods (Zope provides the visual layout, business logic is in ExternalMethods, all from
> one module).  In some of those methods, the code loads Images in order to look up information about them - this is because we have
> some particular standards for things like Image tags which the built-in tag() method can't support,

you sure about that? tag() is pretty flexible...

> 	img = getattr(self.Images,'image.gif')	#all images live in /Images, got by acquisition from self
> 	buildTag(img.title,img.width,img.height)	#use image attributes to build fuller tag
> 	del img						#avoid leaving references around (this is paranoid!)

what does buildTag look like?

> I'd be very grateful for any help on this!

Looks like something somewhere is hanging on to references.
You could try the old fashioned way: keep commenting out bits of your 
code in small chunks until the leak goes away, when it does, analyse the 
bit you've just take out to death ;-)

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope mailing list