Check memory used by a script
Check memory used by a script.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add these lines at the end of your code. | |
echo PHP_EOL; | |
echo "Memory Usage :" . memory_get_usage(); | |
echo PHP_EOL; | |
echo "Real Memory Usage :" . memory_get_usage(true); | |
echo PHP_EOL; | |
echo "Real Peak Memory Usage :" . memory_get_peak_usage(true); | |
echo PHP_EOL; | |
echo "Peak Memory Usage :" . memory_get_peak_usage(); | |
echo PHP_EOL; |