Re: How does memory limit work?

From: Date: Sun, 04 Feb 2001 02:27:41 +0000
Subject: Re: How does memory limit work?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-38051@lists.php.net to get a copy of this message
> 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

« previous php.general (#38051) next »