Re: [PHP-DEV] Memory limit is used for all scripts instead of one?
On Wed, 27 Jun 2001, Brian Moon wrote: What version of PHP are you using? There were some changes in 4.0.6 that may change your results. This error comes from the php site, it's not a bug that the user reported :) regards, Derick Brian Moon -- dealnews.com, Inc. Makers of dealnews, dealmac http://dealnews.com/ | http://dealmac.com/ - Original Message - From: Swift [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 9:52 AM Subject: [PHP-DEV] Memory limit is used for all scripts instead of one? Warning: Could not execute mail delivery program in /local/Web/sites/phpweb/bugs.php on line 419 Mail not sent! Please send this page in a mail to [EMAIL PROTECTED] manually. -- Hi there! As far as I understand, the option memory_limit sets the mem-limit for ONE script. I installed PHP as a Apache module and I set the memory_limit to 16M (via php.ini). When I allocate 8M of memory, all works fine. But when two different scripts each allocate 8M, I will get sometimes the following message: Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4194304 bytes) in /usr/local/httpd/htdocs/testxx.php on line 6 Both scripts (testx.php and testxx.php) contain the following code: ?php $str = x; for($i=0; $i23; $i++) { $str .= $str; echo strlen($str) . br; } ? First, 1 byte will be allocated, then 2, then 4 and so on. The last allocated string has a size of 8M. It's a little difficult to reproduce the problem because I have to call both scripts exactly at the same time from my browser. But, as I said, sometimes I get the described error-message. My question is: Is this normal and memory_limit sets the limit for ALL scripts that are currently running or is this a bug? Thanks in advance! ... tobias wiersch from germany -- PHP Development 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] -- PHP Development 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] Derick Rethans - PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] SRM: Site Resource Manager - www.vl-srm.net - -- PHP Development 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]
Re: [PHP-DEV] Memory limit is used for all scripts instead of one?
I thought I would add my tuppence (= 2 pence = 0.02 GBP) worth: I've been building with --enable-memory-limit to enable the peak mem usage stats in my log files. Recently I noticed that all of a sudden my scripts were chewing up more than 8MB (the default limit in php.ini) and PHP was bailing out. At first I thought that it was a problem in my scripts, but once the message had been reported no more PHP scripts would be served, each failing with the memory limit exceeded message. The only option being to restart Apache, or rebuild without the memory limit. I am using PHP from CVS and first encountered the problem just after the CVS server was brought back up last time (about a week ago). Perhaps these are related, or perhaps this is related to that wierd memory bug that surfaced just before that? --Wez. On 28/06/01, Brian Moon [EMAIL PROTECTED] wrote: What version of PHP are you using? There were some changes in 4.0.6 that may change your results. - Original Message - From: Swift [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 9:52 AM Subject: [PHP-DEV] Memory limit is used for all scripts instead of one? As far as I understand, the option memory_limit sets the mem-limit for ONE script. I installed PHP as a Apache module and I set the memory_limit to 16M (via php.ini). When I allocate 8M of memory, all works fine. But when two different scripts each allocate 8M, I will get sometimes the following message: Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4194304 bytes) in /usr/local/httpd/htdocs/testxx.php on line 6 My question is: Is this normal and memory_limit sets the limit for ALL scripts that are currently running or is this a bug? -- PHP Development 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]
Re: [PHP-DEV] Memory limit is used for all scripts instead of one?
What version of PHP are you using? There were some changes in 4.0.6 that may change your results. Brian Moon -- dealnews.com, Inc. Makers of dealnews, dealmac http://dealnews.com/ | http://dealmac.com/ - Original Message - From: Swift [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, June 27, 2001 9:52 AM Subject: [PHP-DEV] Memory limit is used for all scripts instead of one? Warning: Could not execute mail delivery program in /local/Web/sites/phpweb/bugs.php on line 419 Mail not sent! Please send this page in a mail to [EMAIL PROTECTED] manually. -- Hi there! As far as I understand, the option memory_limit sets the mem-limit for ONE script. I installed PHP as a Apache module and I set the memory_limit to 16M (via php.ini). When I allocate 8M of memory, all works fine. But when two different scripts each allocate 8M, I will get sometimes the following message: Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4194304 bytes) in /usr/local/httpd/htdocs/testxx.php on line 6 Both scripts (testx.php and testxx.php) contain the following code: ?php $str = x; for($i=0; $i23; $i++) { $str .= $str; echo strlen($str) . br; } ? First, 1 byte will be allocated, then 2, then 4 and so on. The last allocated string has a size of 8M. It's a little difficult to reproduce the problem because I have to call both scripts exactly at the same time from my browser. But, as I said, sometimes I get the described error-message. My question is: Is this normal and memory_limit sets the limit for ALL scripts that are currently running or is this a bug? Thanks in advance! ... tobias wiersch from germany -- PHP Development 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] -- PHP Development 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]
Re: [PHP-DEV] Memory limit is used for all scripts instead of one?
On Wed, 27 Jun 2001, Swift wrote: Warning: Could not execute mail delivery program in /local/Web/sites/phpweb/bugs.php on line 419 Mail not sent! What is wrong with the bug system? I've seen around 20 messages like this now. Derick - PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] SRM: Site Resource Manager - www.vl-srm.net - -- PHP Development 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]
Re: [PHP-DEV] Memory limit is used for all scripts instead of one?
memory_limit applies for the duration of a single script. Each script will not be allowed to obtain more than 8MB; So, the problem you're having originates someplace else (perhaps other parts of PHP grow to consume more memory, e.g., persistent resource tables or something of the sort). Zeev At 17:52 27/6/2001, Swift wrote: Warning: Could not execute mail delivery program in /local/Web/sites/phpweb/bugs.php on line 419 Mail not sent! Please send this page in a mail to [EMAIL PROTECTED] manually. -- Hi there! As far as I understand, the option memory_limit sets the mem-limit for ONE script. I installed PHP as a Apache module and I set the memory_limit to 16M (via php.ini). When I allocate 8M of memory, all works fine. But when two different scripts each allocate 8M, I will get sometimes the following message: Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 4194304 bytes) in /usr/local/httpd/htdocs/testxx.php on line 6 Both scripts (testx.php and testxx.php) contain the following code: ?php $str = x; for($i=0; $i23; $i++) { $str .= $str; echo strlen($str) . br; } ? First, 1 byte will be allocated, then 2, then 4 and so on. The last allocated string has a size of 8M. It's a little difficult to reproduce the problem because I have to call both scripts exactly at the same time from my browser. But, as I said, sometimes I get the described error-message. My question is: Is this normal and memory_limit sets the limit for ALL scripts that are currently running or is this a bug? Thanks in advance! ... tobias wiersch from germany -- PHP Development 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] -- Zeev Suraski [EMAIL PROTECTED] CTO co-founder, Zend Technologies Ltd. http://www.zend.com/ -- PHP Development 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]