3
Use cPHP built-in function memory_get_usage () to return the PHP script is currently assigned to the amount of memory, in bytes (byte). In the WEB actual development, these functions are useful, we can use it to debug PHP code performance.
memory_get_usage () function returns the memory usage, memory_get_peak_usage () function returns the memory usage peaks, getrusage () returns CUP usage. But one thing Please note that you need to run on Linux in these functions.