[Zope-dev] memory leak

Karl Anderson karl@digicool.com
13 Apr 2001 15:59:05 -0700


Marco Nova <nova@tera-it.com> writes:

> I've replaced ParsedXML's ExpatBuilder with the pyXML package and I used the
> sax parser without modifing the code (except for the import), this is the
> refcounts results.
> 
> Class  April 12, 2001 11:55 am  April 12, 2001 12:00
> 
> xml.dom.NodeList.NodeList           2103  3678  +1575  
> xml.dom.Text.Text                   1263  2208  +945  
> xml.dom.NamedNodeMap.NamedNodeMap    507   885  +378  
> xml.dom.Element.Element              499   871  +372  
> xml.dom.Attr.Attr                    339   591  +252  
> xml.dom.DocumentType.DocumentType      7    10  +3  
> xml.dom.Document.Document              7    10  +3
> 
> xml.dom.Document.Document increments by 1 each time an xml is procesed (I
> tried to add a del doc at the end but it's ineffective).
> 
> So the problem is not ParsedXML but Zope itself or my bad methods.

Not necessarily - it's been mentioned that PyXML requires releasing
nodes after they're done, so I'd expect this if you replaced
ParsedXML's DOM with PyXML's without adding the release.

-- 
Karl Anderson                          karl@digicool.com