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
<pre> | |
<?php | |
$megabyte = 1528; // define the max megabytes which should be tested | |
function tryAlloc($megabyte){ | |
echo "try allocating {$megabyte} megabyte..."; | |
$mb = $megabyte; | |
$dummy = str_repeat("-",1048576*$mb); | |
echo "pass."; | |
echo "Usage: " . memory_get_usage(true)/1048576; |