Max Memory Usage, PHP
<?php $unit = ['b','kb','mb','gb','tb','pb']; $size = memory_get_peak_usage(true); $usage = @round($size/pow(1024,($i=floor(log($size,1024)))),2).' '.$unit[$i]; echo $usage . PHP_EOL;