in reply to resolution of XML::DOM::Parser memory leak

There is potentially a separate issue with apparent memory leaks in XML::DOM::Parser and those that may or may not have been fixed in XML::Parser. You may experience memory leaks in XML::DOM if you are creating many lexical DOM objects and just letting them go out of scope without caling the Dispose method on them before you do so, this is because there may be (intentional) circular references in the DOM object in memory. I have the same problem with XML::XSLT which uses XML::DOM under the covers and creates a number of DOM objects to hold intermediate results and parts of the template and so forth and it appears to leak like a sieve when processing a large number of documents with the same object.

/J\

Replies are listed 'Best First'.
Re^2: resolution of XML::DOM::Parser memory leak
by wolis (Scribe) on Aug 23, 2004 at 04:34 UTC
    Ah.. thanks for that.. makes perfect sense.

    A quick check of the script and 'dispose' has not been used - adding it at the appropriate spot fixes everything! (woo hoo)

    Mind you the XML file is 2Mb yet 42Mb are used when its loaded - disposing of it, doesnt free up all that memory but loading other XMLs (or reloading the same one) does not continue expand this memory usage (phew)

    I can live with this.

    Thanks again.

    ___ /\__\ "What is the world coming to?" \/__/ www.wolispace.com