Re: PHP 4.0 Bug #8889: Memory is not being freed.

From: Date: Sun, 28 Jan 2001 07:20:12 +0000
Subject: Re: PHP 4.0 Bug #8889: Memory is not being freed.
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-45260@lists.php.net to get a copy of this message
Yes, but it would be really nice if it was returned. Systems with 128MB or RAM run out quickly if there is a script ( like a long Phorum thread ) that takes a good chunk. Of course the argument can be made that the box needs more RAM but if the memory can be returned (maybe even with a php.ini setting that states the max amount PHP should keep) to the system why not do it? Brian Moon ------------------------------------------------------------------------- Phorum Dev Team - http://phorum.org Making better forums with PHP ------------------------------------------------------------------------- ----- Original Message ----- From: "Rasmus Lerdorf" <rasmus@linuxcare.com> To: "Brian Moon" <brian@phorum.org> Cc: "Filip Sielimowicz" <sielim@wp-sa.pl>; <php-dev@lists.php.net> Sent: Sunday, January 28, 2001 12:23 AM Subject: Re: [PHP-DEV] PHP 4.0 Bug #8889: Memory is not being freed. > > It is not a leak exactly but more of a greed. It seems to be a > > semi-intentional but not necessary thing. It seems that the way Zend/PHP is > > allocating memory is not allowing it to be returned to the system. Once PHP > > has some memory it will not let it go, but it will reuse it. So, if a > > script takes up a good chunk of memory, it is never returned to the system > > unless that httpd process is killed or dies. > > Right, this is standard. But this does not explain incremental memory > usage. Memory is marked as free and re-used. It does not need to be > returned to the system for it to be re-used. So the memory usage for any > one process should never exceed the memory usage of your most memory > hungry script. > > -Rasmus > >

« previous php.dev (#45260) next »