Hi
I am trying to parse a huge xml file originating from a feed which
cannot load at once, so I have to use:
while (!feof($handle)) {
$line = stream_get_line($handle, 1000000, "\n");
$xml = new Xml($line);
Above is a simplified version, actually I modified $line in order to
be the xml document as each $line is an element with many subelements.
The data then is save into a db. I works great until the script gets
out of memory.
I have tried a lot of thing and found out what I suspected from the
beginning; the problem is the line:
$xml = new Xml($line);
Using memory_get_usage() I can see that the memory usage grows and
grows, so I am doing something wrong, how could I clear the old $xml
so it really will be cleared? I have tried various things like unset
($xml) etc but it did not work, the data still exists somewhere.
Thanks, Yves.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---