I need to parse a very big XML file, with a filesize of 750Mo !
I have meomy limit at 512M
ini_set('memory_limit', '512M');
I have no problem to open file under 30Mo, but with 750Mo, I obtain a fatal error
Fatal error: Allowed memory size of 1677721600 bytes exhausted (tried to allocate 2988843769 bytes)
I do that to open files :
$fichier = file_get_contents($inputfileName);
$xmlInput = simplexml_load_string(utf8_encode($fichier));
Have you an idea to open this file ?
Using the DOM based extensions will take up significantly more memory as the raw XML is because the XML will be parsed completely into a tree structure of nodes. Have a look at XMLReader instead
and make sure you parse with
LIBXML_PARSEHUGEAn alternative would the event-based XMLParser