I have to parse an XML file which is ... 1,8 Go large ! My first try was with a simple XML::Parser::Wrapper and of course, it worked perfectly with an example, but ended with 'out of memory' with the real one !!
I then found on the net an article from Kip Hampton from 2001 (on XML.com) which starts with : "The Problem : The XML documents you have to parse are getting too large to load the entire document tree into memory; performance is suffering. The solution : use SAX". So i drop into XML::SAX, and after a while, understood (i hope) how to code my own handler package with common 'start_element', 'end_element', 'characters', ... methods to do the job.
Again everything is going well with the test file, but when i launch the script with the big one, memory usage starts to reach 100%, then it's the swap usage, and then ... i killed it.
Do you think it could comme from a bad way of coding, or is the module inapropriated, for such a big file ? And if so, would you know a module i could use to read the file inline, without loading all into memory ?
Thanks
julien
In reply to How to Parse Huge XML Files ? by Marsel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |