Hi!
I have a script that uses a lot of memory and an ISP that has memory-limit
set to 10 Mb. The script of course doesn't finish running. :(
The program is rather simple - it parses XML into an array and then starts
the loop that inserts data into the database. If I use a very large XML
file then the PHP crashes inside the loop (Fatal error: Allowed memory size
of 10485760 bytes exhausted) - indicating that the problem lies within loop
somewhere.
Can I trace memory consumption of a PHP script so I can determine where the
memory is wasted?
If PHP uses all the memory (and frees nothing) until the end of the script
then that could be the problem - is there any way I can force it to do
garbage collection?
Any comment on how PHP uses memory would be appreciated - I would really
hate to have to break the script into smaller pieces (or change ISP for
that matter :) ).
Thanks!
Anze