Re: Memory limit is used for all scripts instead of one?
| From: | Wez Furlong | Date: | Fri, 29 Jun 2001 08:06:54 +0000 |
| Subject: | Re: Memory limit is used for all scripts instead of one? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-58392@lists.php.net to get a copy of this message | ||
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" <brianm@dealnews.com> 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" <swift@fanpro.com>
> To: <php-dev@lists.php.net>
> 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?