[Zope-dev] XMLDocument appears to leak memory

Amos Latteier Amos@digicool.com
Wed, 1 Sep 1999 15:06:51 -0400


> David Kankiewicz wrote:
> > Martijn Faassen wrote:
> > I think I've seen an earlier report and I'd like to confirm 
> this. XML
> > Document appears to leak memory pretty badly:
> > 
> > * When rendering it with DTML to HTML, Zope's memory use 
> often goes up a
> > few kilobytes. Not all the time, it appears, but a reload 
> often does the
> > trick.
> > 
> > * It also appears that doing a DOM manipulation (for instance
> > appendChild) increases Zope's memory use significantly; by 
> a few 10s of
> > k.
> > 
> I've been working with the Zope Quick reference in XML and have found
> Zope's internal XML Documents are on about 10 times the size 
> compared to
> stand alone file. (my guess, seems to be the DOM 
> information?). With the
> manipulation, it might be the storage required to undo (not sure?).

Well, I suppose that it is possible there are memory leaks in XML
Document, however I'd like to see stronger evidence before I jump to
that conclusion.

XML Document uses a lot of resources. DOM creates a lot of objects, and
the estimate that a Zope DOM representation of an xml file is 10 times
as large as the file is probably a reasonable estimate.

Displaying an XML Documents wakes up quite a few objects. Editing XML
Documents can create quite a few new objects since it is difficult for
XML Document to know when to change existing Nodes and when to create
entirely new Nodes.

It is on my todo list to improve memory use in XML Document. For example
steps can be taken to move temporarily needed objects out of memory.

If anyone has more specific problems or reproducible cases of memory
getting out of control, I'd love to hear them. Please remember, however,
that XML Document is unsupported; I just work on in my spare time.

Thanks!

-Amos

P.S. Another version of XML Document is coming out today. It is a *lot*
better than the first alpha release.