You can put the below code in a memory.php file and then view the result from browser by http://yourdomain.com/memory.php
echo 'Current Memory Usage: '.number_format(memory_get_usage()/1024/1024,"2",".",",").' MB'."\r\n";
echo 'Current Memory Allocted: '.number_format(memory_get_usage(true)/1024/1024,"2",".",",").' MB'."\r\n";
echo 'Peak Memory Usage: '.number_format((memory_get_peak_usage()/1024/1024),"2",".",",").' MB'."\r\n";
echo 'Peak Memory Allocated: '.number_format((memory_get_peak_usage(true)/1024/1024),"2",".",",").' MB';
echo 'Current Memory Usage: '.number_format(memory_get_usage()/1024/1024,"2",".",",").' MB'."\r\n";
echo 'Current Memory Allocted: '.number_format(memory_get_usage(true)/1024/1024,"2",".",",").' MB'."\r\n";
echo 'Peak Memory Usage: '.number_format((memory_get_peak_usage()/1024/1024),"2",".",",").' MB'."\r\n";
echo 'Peak Memory Allocated: '.number_format((memory_get_peak_usage(true)/1024/1024),"2",".",",").' MB';
Comments