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

Ben Last (ZODBDev) zodbdev at benlast.com
Fri Jan 28 11:44:16 EST 2005


Thanks, Tim; very informative.

I think I expressed myself badly... I do understand how references work in Python, I guess what I'm concerned about is why the Image
class has so many references (which may not be a problem) and (more of a concern) try to see if those references relate to actual
instances.  I used the term "reference leak" to distinguish this from a simple memory leak.

Very little actual referencing of Images happens in our code (a=b, etc), so I'm still concerned as to why the reference count always
increases.  All the references that are created (I've checked the damn things every one) are in either:
a) local variables which *presumably* go out of scope when the external method they're in is exited
b) temporary objects that are returned from ExternalMethods to PageTemplates so that they can be used in ZPT expressions

As such, I think I'd restate the question as follows:
How do I track the creation (and destruction) of *instances* of a given Persistent class (such as OFS.Image.Image)?

If I can do that, I can at least see how many instances are being created for every actual image to see if there's duplication.

Regards and thanks
Ben




More information about the ZODB-Dev mailing list