in reply to Huge amount of memory used with XML::DOM

perhaps some of your code would help...post an example snippet of where the parsing is performed
  • Comment on Re: Huge amount of memory used with XML::DOM

Replies are listed 'Best First'.
Re: Re: Huge amount of memory used with XML::DOM
by Sihal (Pilgrim) on Dec 09, 2003 at 09:08 UTC
    Ok

    This is what I used to do:

    my $xml = getXML($url); # retrieve it thru http my $parser = new XML::DOM::Parser; my $doc = $parser->parse($xml); # This first snippet would take as much as 2Gigs of memory.
    Now, I do this:

    my $xml = getXML($url); # retrieve it thru http my $file = writeToFile($xml) or return; my $parser = new XML::DOM::Parser; my $doc = $parser->parsefile($file); # This isn't even noticeable


    Any Ideas why the first form is so greedy in memory?
    Never found anything about this in the doc.

    Thanks a lot.