pixeloution
8/25/2014 - 9:23 PM

Max Memory Usage, PHP

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;