RE: [PHP-DEV] Forced garbage collection

From: Date: Thu, 29 Jun 2000 19:08:41 +0000
Subject: RE: [PHP-DEV] Forced garbage collection
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-22910@lists.php.net to get a copy of this message
There could be libc "memory leaks". I am not sure which libc's free unused pages once they have been allocated. Andi At 11:49 AM 6/29/00 -0700, Rasmus Lerdorf wrote:
The only way for PHP to leak memory like this is if a 3rd party library which does not use PHP's memory management routines are leaking. In your case it sounds like there might be a problem in libxml, or it could be a problem in the way PHP is using the libxml API. As for your Apache recycling question, set your MaxRequestsPerChild to a lower (non-zero) value. -Rasmus Ok. I know it obvious that I need to retest this problem on 4.0.1. However, I take it from both Andi and Rasmus' response that garbage collection should definately have occured by the end of the script. Also, there is presumably no way to force garbage collection at the end of a script becuase it should have happened anyway. I seem to recall that there was some way or forcing apache daemons to recycle. Does anyone recall how to do this? Or, if it is even possible? Thanks
-----Original Message----- From: Andi Gutmans [mailto:andi@zend.com] Sent: Thursday, June 29, 2000 11:19 AM To: Peter Kocks Cc: php-dev@lists.php.net Subject: Re: [PHP-DEV] Forced garbage collection Actually PHP is supposed to clean up after itself at the end of the request, it does so since PHP 3 (maybe even PHP/FI 2). How about upgrading to PHP 4.0.1 and mailing us again with new stats/information. Andi On Thu, 29 Jun 2000, Peter Kocks wrote:
Hi all, I have php script that grows apache to over 71M on a system. The
script
parses an XML message that is over 19,000 lines long. The
problem is not
that the script takes up 71M (although that's higher than I'd
like), it is
that after the script ends, the apache daemon stays at 71M. It
seems that
either there is a memory leak or that garbage collect did not occur. Is there any way to force php to do garbage collection? Or has
it certainly
occurred when a script ends? Is there a way to force apache to recycle an httpd daemon at
the end of a
request, so the OS cleans up the memory? My real problem is that I end up with a dozen 71M apache daemons after servicing several requests and I run out of swap space. If I
had just one
or two 71M daemons I'd be fine. (Apache/1.3.12 (Unix) PHP/4.0b4pl1) running on Solaris 2.7. Yes, I
know
php4.0b4pl1 is old and I will fix that. However, I'd still
like to know if
there is a way to force memory cleanup in some way regardless
if the latest
rev of php fixes this problem. Thanks in advance Peter Kocks
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net
--- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#22910) next »