in reply to Perl XML::Smart Out of memory! error
The XML file is 21.5MB in size. I know it gets stuck at the point of parsing the file
Does it still fail if you try it on a smaller file? (Like the sample you posted.)
If not, it suggests that the the process of parsing the file and building the complex, nested data-structure that results from it, is consuming more memory than is available.
Suggestions:
- Install a 64-bit Perl.
32-bit perls are limited to using 2GB of memory. Most machines these days have much more than this available.
A 64-bit Perl will allow you to use all the memory your machine has available.
- Use a different XML parser.
XML::Smart is a particularly memory hungry module because of its design. Another XML parser might be able to parse the whole file whilst using less memory.
Some XML modules are explicitly designed to handle files that are too big for memory, by only parsing/retaining a subset of the file in memory at any given time. eg. XML::Twig
|
---|