View Single Post
  #51  
Old 12-15-2008, 06:46 AM
[QT]bender [QT]bender is offline
Member
 
Join Date: May 2008
Posts: 16
Hi guys. I think I need same patch too. We are having application that require memory limit higher than 256 MB and I have memory_limit set to 512, but scripts stop working at 256 MB of memory. I have used the following script to test this out:

PHP Code:
<?
$begin 
getmicrotime();

error_reporting(E_ALL);
$mem_lim=ini_get("memory_limit");
$num_iterations=$mem_lim-1;
// increase memory limit
#ini_set("memory_limit", "256M");
ini_set("max_execution_time""60");
echo 
"memory limit set to $mem_lim<br>";
echo 
"max_execution_time set to " ini_get("max_execution_time") . "<br>";
echo 
"Building very long string ... <br>";
flush();
$array = array();
for (
$i 1$i <= $num_iterations$i++) {
echo 
"Adding 1M data ... ";
add($array);
echo 
"[OK] Total: $i Mb<br>";
}
#echo "<br>[OK] Total: $i Mb<br>";
$end getmicrotime();
echo 
"Execution time: "; echo $end $begin;

function 
getmicrotime() // {{{
{
list(
$usec$sec) = explode(" ",microtime());
return ((float)
$usec + (float)$sec);
}


function 
add(&$array)
{
$array[] = $str str_repeat("*"1024*1024);
return 
$array;
}
?>
Look forward to hearing from you.
Reply With Quote