I am porting a large web application to a shared web hosting environment. The app was written in PHP 4. The new environment has PHP 5.2.
For some reason, the application is leaking tremendous amounts of memory when running in PHP 5.2. I can literally watch memory usage going through the roof using memory_get_usage(), until it reaches the limit of 64 MB (which is very generous in a shared environment, the site used to run with 12 or 16 MB on PHP 4).
I suspect that this is a side-effect of something that has changed in PHP 5, most likely the handling of object references in arguments. However, the search for the particular behaviour(s) that cause(s) the leak is extremely difficult as the application is very complex, and partly not very well written (yes, it is mine).
As the app is installed on a shared webspace, I can not use the classical debugging facilities (as far as I know). I would very, very much like to avoid recreating the environment locally, as I am working on the project literally all day for some time.
So my questions are:
Does anybody know typical PHP4 => 5 transition pitfalls, especially when dealing with large amounts of objects, that might be the cause for my leak(s)
Does anybody know some kind of debugger-independent, script-only "graphical scope dump" tool for the variables used by PHP that might help me find out which variables are eating up these enormous amounts of memory?
Thanks in advance. Pekka