Which of the following PHP functions can be used to get the current memory usage?
memory_get_usage()
Correct:
memory_get_usage()
Explanation:memory_get_usage() returns the amount of memory, in bytes, that’s currently being allocated to the PHP script. We can set the parameter ‘real_usage’ to TRUE to get total memory allocated from system, including unused pages. If it is not set or FALSE then only the used memory is reported. To get the highest amount of memory used at any point, we can use the memory_get_peak_usage() function.