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.
|