Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Feb 2006 19:42:36 -0800
From:      Jeremy Chadwick <freebsd@jdc.parodius.com>
To:        freebsd-ports@freebsd.org
Subject:   Re: Mystery memory leak message in PHP 5
Message-ID:  <20060211034236.GA92772@pentarou.parodius.com>
In-Reply-To: <20060210182047.P78074@goodwill.io.com>
References:  <20060210182047.P78074@goodwill.io.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> Although php5-cli was built from ports, the port was cleaned
> long ago, so the work directory no longer exists, and I have no
> idea where to start looking for the problem:
>
> My script?
> PHP source?
> The port?
> The system?

Chances are the leak is in the PHP code.  You should likely submit
your findings to the PHP developers via their bug page, but first:

Try using php 5.1.2 (which is what's currently in ports).  The PHP
developers are usually quite adamant about fixing memory leaks.
If you want to know the differences between 5.0.5 and 5.1.2, the
PHP developers keep a somewhat terse ChangeLog on their web site.

> What will happen if I keep running these scripts?  Will I
> eventually run out of memory?  Or is the memory recovered when
> the script quits?  {...}

The memory is recovered when the script quits, but it depends on how
you have PHP built + configured for Apache (or whatever webserver
you're using).  If you're using PHP as an Apache module, then there
may be times when the Apache process gets bloated (it depends on how
much memory is leaking, and at what rate), which may require you to
restart Apache.  If you're using PHP as a CGI (not CLI!) binary, the
memory is guaranteed to be free'd every time the fork()'d instance of
PHP dies off (in English: when the script ends).

-- 
| Jeremy Chadwick                                 jdc at parodius.com |
| Parodius Networking                        http://www.parodius.com/ |
| UNIX Systems Administrator                   Mountain View, CA, USA |
| Making life hard for others since 1977.                             |




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060211034236.GA92772>