Christie Christie - 2 months ago 11
Linux Question

How to see which PHP script is consuming the most memory?

I'm trying to see which of my PHP scripts uses the most memory and CPU when it's viewed by a browser. I can only find methods like

top
and
free
that show per-process usage, but I need it narrowed down for a particular PHP script. Is there any way to do this?

Answer

If you want to see how much memory a particular PHP script uses you can use the memory_get_usage function listed here.

Comments