I'm working on a project where I recieve a big SOAP result (about 250 MB) that I need to parse. I get out of memory errors all the time - now I have set memory_limit to 1024 MB, and it does not feel good. $client = new SoapClient("http://www.example.com/soap/?WSDL", array("location"=>"http://www.example.com/soap/"); $data = $client->getInfo(); foreach($data as $row) { // do stuff } Code (markup): Any ideas how I can reduce memory usage, or at least free some while parsing data?
If you delete your array values as you loop through it can reduce the memory usage. Can you post what's in the do stuff section? It's hard to give a recommendation without knowing what the script is doing. However with that memory limit and a 250Mb dataset, there isn't a lot of room.