function getMemUsage() {
$output = array();
@exec('tasklist /FI "PID eq '.getmypid().'" /FO LIST', $output);
$a = $output[3];
$m = explode(" ",trim($a));
return round(preg_replace('/[\D]/', '', $m[count($m)-2])*1024, 5);
}
echo 'OS: '.$_ENV['OS']."
";
echo 'Current PHP version: '.phpversion()."
";
echo 'Server signature: '.$_SERVER['SERVER_SIGNATURE']."
";
echo 'Server software: '.$_SERVER['SERVER_SOFTWARE']."
";
echo "
";
echo "Before alocate WINDOWS get_memory_usage - ".getMemUsage()/(1024*1024)." MB.
";
if (str_replace(".", "", phpversion())>=525) echo "Before alocate LINUX get_memory_usage - ".memory_get_usage()/(1024*1024)." MB.
";
$alocateMemory=str_repeat("1", 5*1024*1024);
echo "After alocate 5MB of memory WINDOWS get_memory_usage - ".getMemUsage()/(1024*1024)." MB.
";
if (str_replace(".", "", phpversion())>=525) echo "After alocate 5MB of memory LINUX get_memory_usage - ".memory_get_usage()/(1024*1024)." MB.
";
?>