Monday, 2 March 2015

Where simplexml_load_file of PHP function locate data in memory



I am loading XML file by simplexml_load_file() in PHP script. XML file has 50MB size. Before and after the function is get_memory_usage() witch returns the same values. I see that the process is locating about 400MB in RAM. So, where is it located? I need to clear it before the scripts going die.



function mem() {
echo round(memory_get_usage(true)/1024/1024, 2) . 'MB' . PHP_EOL;
}

mem();
$xml = simplexml_load_file("trips.xml");
mem();


mem(); everytime returns 0.25M but process has 400MB.


No comments:

Post a Comment