[Zope-dev] copy & paste 'leakage'

Shane Hathaway shane@zope.com
Fri, 08 Feb 2002 13:10:36 -0500


Martijn Faassen wrote:
> Another data point. Copy & paste of ParsedXML documents is normal
> and fast when the object is in a folder not surrounded by too
> many other folders (or objects in general, not sure yet). If I create
> a bunch of very large folders sitting next to the ParsedXML document
> that I'm going to copy, the copying process slows down and generates
> a lot of extraneous megs that I can then clean out again from the ZODB.
> 
> Somehow the document is being affected by its environment, though I 
> doubt I have the full story yet (I did have problems with folders that
> were not filled with anything else before).

The manage_beforeDelete() and manage_afterAdd() events are propagated to 
subfolders, meaning that a whole lot of objects have to wake up every 
time you add or remove something.  Or it might be manage_afterClone() 
being called, which is very similar.  You could add a temporary print 
statement to ObjectManager.manage_after* to see just how often the 
methods are getting called.

The solution?  Event management.  Make objects register to receive events.

Shane