From owner-freebsd-ports@FreeBSD.ORG Sat Feb 11 03:42:36 2006 Return-Path: X-Original-To: freebsd-ports@freebsd.org Delivered-To: freebsd-ports@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CA43C16A420 for ; Sat, 11 Feb 2006 03:42:36 +0000 (GMT) (envelope-from jdc@parodius.com) Received: from mx1.parodius.com (mx1.parodius.com [64.62.145.229]) by mx1.FreeBSD.org (Postfix) with ESMTP id 63E9043D48 for ; Sat, 11 Feb 2006 03:42:36 +0000 (GMT) (envelope-from jdc@parodius.com) Received: by mx1.parodius.com (Postfix, from userid 500) id 1EC925E01; Fri, 10 Feb 2006 19:42:36 -0800 (PST) Date: Fri, 10 Feb 2006 19:42:36 -0800 From: Jeremy Chadwick To: freebsd-ports@freebsd.org Message-ID: <20060211034236.GA92772@pentarou.parodius.com> Mail-Followup-To: freebsd-ports@freebsd.org References: <20060210182047.P78074@goodwill.io.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060210182047.P78074@goodwill.io.com> X-PGP-Key: http://jdc.parodius.com/pubkey.asc User-Agent: Mutt/1.5.11 Subject: Re: Mystery memory leak message in PHP 5 X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2006 03:42:36 -0000 > 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. |