Re: PHP 4.0 Bug #6333 Updated: garbage collection is not being performed on create_function?

From: Date: Thu, 07 Sep 2000 16:12:36 +0000
Subject: Re: PHP 4.0 Bug #6333 Updated: garbage collection is not being performed on create_function?
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-32572@lists.php.net to get a copy of this message
Yes I know how it works. But seeing as you have features like bind(), listen() and other functions normally associated with proper 'applications' you will inevitably get people running shell scripts 24/7. Such as what I have done, I made a ircbot in PHP that stays connected even though you reload its script 'modules', except I have to restart it every so often to flush memory because of this 'bug'. Im probably not going to be the only one, either. PHP is much more than simply a pre-html parser. Its pretty much replaced PERL for me. - ewdafa / ed ----- Original Message ----- From: "Bug Database" <php-dev@lists.php.net> To: <ewdafa@ewdafa.b0rk.co.uk> Sent: Thursday, September 07, 2000 4:43 PM Subject: PHP 4.0 Bug #6333 Updated: garbage collection is not being performed on create_function? > ID: 6333 > Updated by: andi > Reported By: ewdafa@ewdafa.b0rk.co.uk > Status: Closed > Bug Type: Performance problem > Assigned To: > Comments: > > This isn't a bug but how it works. Each create_function() call creates a new unique function. So obviously if you define zillions in an infinite loop you'll run out of memory. > > Previous Comments: > > [2000-08-24 09:57:38] ewdafa@ewdafa.b0rk.co.uk > the following code causes PHP to continually eat more and more memory where it should be destroying the old reference for $func. > > while(1) { > $array = array(); > $func = create_function('', "return 0;"); > $array[] = $func; > $func = 0; > echo "sleeping for a second.n"; > sleep(1); > } > > > -------------------------------------------------------------------------- - > > > Full Bug description available at: http://bugs.php.net/?id=6333 > >

« previous php.dev (#32572) next »