Project

General

Profile

Files ยป phpmemtest.php

memory test script - nant, 18 June 2018 13:06

 
<?php

for ($i=1; $i<100; $i++) {
$a = loadmem($i);
echo "You have allocated ". $i . "M (". memory_get_usage() . ") memory in this php script" . "<br />";
unset($a);
}

function loadmem($howmuchmeg) {
$a = str_repeat("0", $howmuchmeg * 1024 * 1024); // alocating 1 Mchars
return $a;
}

?>
    (1-1/1)