> I am trying to prevent my Linux machine from crashing by the use of
> memory_limit, but is does not seem to work as I expect it to: When a
> php-script includes itself recursively by accident it grabbes all memory
> available in a matter of seconds, although I set max_execution_time=30
> and memory_limit=8388608. After 30 seconds of execution the apache
> terminates the request, but the script keeps on running and allocating
> memory (far more than 8 MB). Do I misunderstand the memory_limit option?
> Is there an other way to limit memory usage besides system wide memory
> quotas?

The granularity of the PHP memory limit is rather coarse -- It only checks
for available RAM at specific times.

It's not really designed to stop somebody from doing something quite that,
err, well, silly.  (Or perhaps malicioius?)  It's more of a convenience for
beginning scripters to not kill themselves with infinite loops.

Also, the memory quota was broken in some not-too-old versions of PHP.
Check your version and search http://bugs.php.net

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to