ecuguru has asked for the wisdom of the Perl Monks concerning the following question:
I'm guessing that its my usage of XML Dom. For each xml file in a directory, I create a new parser and a new doc. But I haven't found any code that will let me delete or free the parser or the doc the parser is parsed into. Could that be the problem? If so, how do I free it, and which should I free?perl(8145) malloc: *** vm_allocate(size=8421376) failed (error code=3) perl(8145) malloc: *** error: can't allocate region perl(8145) malloc: *** set a breakpoint in szone_error to debug Out of memory!
ANSWER: Looks like its $doc->dispose.use XML::DOM; my @files = <$datapath/*.*>; foreach my $file (@files) { my $parser = XML::DOM::Parser->new(); my $doc = $parser->parsefile($file); ##I parse the documents }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML Out of Memory
by samtregar (Abbot) on Jul 19, 2007 at 04:39 UTC | |
by ecuguru (Monk) on Jul 19, 2007 at 14:58 UTC |