Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
more useful options
 
PerlMonks  

Re: Huge amount of memory used with XML::DOM

by bear0053 (Hermit)
on Dec 08, 2003 at 13:12 UTC ( [id://313166]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://313166]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.