zodb-dev@zope.org
[Top] [All Lists]

Re: [ZODB-Dev] Investigating a Zope reference leak... tracking object cr

Subject: Re: [ZODB-Dev] Investigating a Zope reference leak... tracking object creation
From: Chris Withers
Date: Wed, 02 Feb 2005 10:09:56 +0000
Ben Last (ZODBDev) wrote:
<img tal:replace="structure python:here.scripts.getGraphic(here,environment,'myimage.gif',...)"/>

And does this provoke your leak?

That I don't know, that's why I'm trying to track instance creation :)

Why are you bothering to do that? This goes back to my original debugging suggestion: you're aiming to get the simplest possible test case which ALWAYS shows a leak...

Are any arguments passed which aren't simple strings?

Yes. The environment, for instance, is a "dictish object" which means that one can access the members as attributes as well as using dict syntax.

Why are you bothering with this? And what does the code being this object look like? Funny business like this is often the source of leaks...

    if flash is None:
        flash = getattr(environment,'flash',False)

What's flash?

b) a boolean (strictly, something that evaluates True/False in Python)

Okay, so when is it not either the True or False singleton?

This is used in many places, and there appear to be no leaks of them at all.

That's like saying "guns are used in many places, and no-one has shot themselves in the foot". It doesn't mean there's nto blood pouring out of your foot ;-)

We use the dictish objects because otherwise, when writing Python in the context of ZPT, one needs always to be aware of when one's dealing with an object (most cases) or a dict (edge cases)

Why?

number of times that caused problems was growing. We adopted an idiom by which multiple-value results are always returned as objects.

I'd suggest that is "wrong". The most common way to do this is to store things in a simple python dictionary and return that.

What's "doTag" ?

A method

A method of what? Where's the code?

that takes the parameters (all are simple except img) and

And what is img?

    except AttributeError:
        pass

Why pass? might be interesting to see what throws attribute errors and why?

It would be on the test site. In the production environment, problems like this would get reported via Zope error pages to customers, who aren't interested in them!

Jeez, talk about sweeping crap under the carpet... if you're getting attributeerrors, find the source, don't just ignore them...

    if swftarget:
        graphic = flashOverride(here,swftarget,graphic)

What does this do?

Looks to see if there's a flash file that can be used to replace the graphic. In the current test version of the site, all the Flash files have been removed whilst we've been tracking the leak, so in effect it's a no-op.

Then take it out, see if the leak goes away... There's always Undo to bring it back later...

Chris

--
Simplistix - Content Management, Zope & Python Consulting
           - http://www.simplistix.co.uk
_______________________________________________
For more information about ZODB, see the ZODB Wiki:
http://www.zope.org/Wikis/ZODB/

ZODB-Dev mailing list  -  ZODB-Dev@xxxxxxxx
http://mail.zope.org/mailman/listinfo/zodb-dev

<Prev in Thread] Current Thread [Next in Thread>