Project

General

Profile

Files ยป phpmemtest.php

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

 
1
<?php
2

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

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

    
14
?> 
    (1-1/1)