Re: reference counting and garbage collection

From: Date: Fri, 03 Nov 2000 22:26:48 +0000
Subject: Re: reference counting and garbage collection
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-23651@lists.php.net to get a copy of this message
Parents and children aren't normally a concern, as everything is running under one instance - either a seperate spawned cgi process, or inside a specific apache process. Without seeing his code and comments, it's difficult for me to understand why he'd say this. I'll reiterate my point - I've had servers up for months running PHP stuff, in some cases with rather complex arrays and data structures, and I've never had a memory leak issue. *IF* you're using the Apache module version and are concerned about this, just had the apache child process a max number of requests before dying (don't leave MaxRequests at 0 - set it to 10000) It may be that the conditions he's talking about are possible, but could be caused by trying to make PHP do something it wasn't designed to do. I'm happy to be proved wrong, tho, because that'll be one more thing that I know about with more detail. :) Dean Hall wrote: > > I'm pretty sure this person doesn't quite know what they're talking about. > > http://www.zend.com/zend/art/ref-count.php is an article > > by Zeev that has a lot of info on reference counting. There are a couple > > issues they mention with respect to being careful with code, > > but I've never seen anything regarding this. In fact, PHP4 in particular > > has been, in my experience, the only platform I've never had any garbage > > collection > > issues with at all, and I don't unset() things all that much. > > Yes, but in particular, what we're talking about is circular references. I'm > not totally sure why this would cause a problem, but that's the reasoning > this guy gave. He said that since he has circular references, (that is, a > child had a reference to its parent, and that parent had a reference to that > child), it would cause a memory leak. I don't see how it's a problem, but I > want to make sure. > > I've been running my own NavNode class (an n-ary tree with circular > references) for some time and it doesn't seem to cause any problems, but I > want to make sure. > > Dean. > -- ========================== Michael Kimsal http://www.tapinternet.com 734-480-9961

« previous php.general (#23651) next »