Reputation: 43
I'm struggling here, probably due to the fact that I'm not a php expert (yet) and definitely a little lacking in linux administration, but learning. I've looked for documentation on how to find the memory leak that my code definitely has, and a lot of articles suggested xdebug. I got it installed, turned on logging briefly and used tracefile-analyser.php to dump out the following report. The problem I now have, is finding proper documentation on the tracefile script to explain what each column means. Can someone either point me to a straight forward "if you see X, this means it is a memory leak" type documentation or explain how I would find the function calls leaking memory in the following output?
Upvotes: 3
Views: 11236
Reputation: 151
Based on the documentation, if xdebug is set to capture trace information in machine-readable format, it records the amount of memory in use when the program begins a function, and then how much memory is being used when the program exits the function.
I'm not sure what program you are using the parse the trace file, but I would guess that they are displaying the total memory usage for your program in the first column, and in the second column displaying how much memory the individual function uses.
If you are already pulling the traces in machine-readable format (xdebug.trace_format = 1 in your php.ini) you may want to try Xdebug Trace Tree to view the results. It shows a column specifically for the change in memory usage.
Upvotes: 3