[PHP-DEV] PHP Does not honor memeory Limit. From: Greg Morse (greg.morse <email protected>)
Date: 05/23/00

PHP Support:
We have taken to using PHP Extensively in some prodcution aplications.
Just recently we came across this error.

When we run the following php script, we use up all the memory in the
machine.

The symptoms are that there is no memory for any Linux process or daemon
to run.

We need to reboot to get out of it.

We are running RH Linux 6.0/6.1. Our boxes have 40MB 64MB and 128 MB of
RAM.
PHP Limit is set to 8 MB.

The memory allocated to the php process (as reported by the ps -eo
command)
keeps climbing as long as the loop is running. It is not limited to 8MB.

The problem occurs on PHP3 and PHP4, for both a DSO in Apache and a
separately compiled cgi process.

Any ideas?

Thank you.

set_time_limit(4000);

for ($n=0; $n<=$max; $n++)

{

  $a[$n]="a$n ";

  $b[$n]="b$n ";

  $c[$n]="c$n ";

  $d[$n]="d$n ";

  $e[$n]="e$n ";

  $f[$n]="f$n ";

  $g[$n]="g$n ";

  $h[$n]="h$n ";

  echo "$a[$n] $b[$n] $c[$n] $d[$n] $e[$n] $f[$n] $g[$n] $h[$n]\n";

}

?>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>