[ZODB-Dev] Investigating a Zope reference leak... tracking object creation

Ben Last (ZODBDev) zodbdev at benlast.com
Mon Jan 31 05:18:57 EST 2005


Thank you very much for your reply, Dieter.

Dieter Maurer wrote:
> Do we speak about the same caches?
>   I meant "Control_Panel" --> "Database managemanet" --> "main/temporary"
>   --> "Flush Cache" --> "Minimize"
Yes, that's the caching I meant.  The pages are *also* proxy-cached to avoid the amount of times the Zope/ZPT code needs to be run to serve a given page.

>>Problem is that I don't have any persistent objects.
> Really?
I should be clearer - my apologies.  We have no persistent objects *of our own types*.  We're using only the built-in Zope 2.7.3 ones.

>>The images are loaded
> I assume from the ZODB
Yes.

> Even when you delete the reference variable, the object remains
> in the ZODB cache. The ZODB has its own cache replacement
> strategie which may sooner or later flush the image from the cache.
I understand.  What I was after (and still am) is a way to track the creation of *instances* of the Python class.  Those may be created when the objects are loaded from the ZODB, or in other ways: I don't know.  But I'd like to be able to print a traceback whenever an object of class OFS.Image.Image is created, in the Python sense of "created".  That is, not when a persistent OFS.Image.Image is added to the ZODB through the ZMI, manage_addImage, etc, but when a Python object of type OFS.Image.Image is created (or deleted).

> You can often force the object explicitely from the cache by
> calling its "_p_deactivate" method (this will work when the object
> is not modified in this transaction).
Ah, thank you.  That may give me some clues to work with.

Regards
ben


More information about the ZODB-Dev mailing list