7
votes

I have a rather large PHP script that is leaking memory. I have been able to figure out what object is leaking, but I have not been able to find out where in the script it is leaking. Some part of my script is keeping a reference to the leaking object.

Is there some way that I can track (and preferably backtrace) where/when a PHP object has it's reference count increased or decreased?

2

2 Answers

1
votes

Try to use:

Also, I suggest to write the code in a easy-to-debug manner and separate the debugging procedures from the code.