note 48030 deleted from language.types.resource by nlopess
| From: | nlopess@php.net | Date: | Mon, 27 Dec 2004 10:04:49 +0000 |
| Subject: | note 48030 deleted from language.types.resource by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-82343@lists.php.net to get a copy of this message | ||
Note Submitter: neil
----
Is there more information about the PHP GC?
I've always explicitly cleaned up my resources and objects and would be interested in finding
out more about this PHP GC process, whether it's more efficient than good housekeeping, how
reliable it is, known issues, etc.
Back in the mid-90's MS came out with an automagic garbage collector, and hyped it to ASP and
VB programmers (hey if it pays, I'll program in BASIC). I steadfastly ignored it and continued
good housekeeping. It sometimes irritated people when I suggested that they make sure to close their
connections etc. They would respond with "You don't need to do that, the server does it
for you."
Well, at a conference in Redmond the IIS and VB engineers directly countered the hype and told us
that when your server needs to be rebooted 3x a week, its usually because the garbage collector is
missing stuff, and "you should always explicitly kill all of your objects and resources".
I still consider that piece of advice to be one of the best (only?) useful contributions that
microsoft made to my career. Always clean up, free the memory and resources the moment you no longer
need them, etc. and I'm anal about it.
I still feel that way, is there a compelling reason not to do good housekeeping in PHP? I can't
help but wonder if there are apps out there with memory leaks that result from the garbage collector
missing something.