Re: reference counting and garbage collection

From: Date: Fri, 03 Nov 2000 22:34:25 +0000
Subject: Re: reference counting and garbage collection
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-23653@lists.php.net to get a copy of this message
Yeah, I noticed that. This was from a class called XMLFile off of some site where people post their own code. I was interested in learning from his so I could write my own, :-) and lo, and behold, here comes this news about circular references. I don't see how this could be a problem in PHP4, since every (non-persistent) variable is nuked when the script ends. Thanks for the help. Dean. ----- Original Message ----- From: "Michael Kimsal" <michael@tapinternet.com> To: "jeremy brand" <jeremy@nirvani.net> Cc: "Dean Hall" <hall@apt7.com>; <php-general@lists.php.net> Sent: Friday, November 03, 2000 4:28 PM Subject: Re: [PHP] reference counting and garbage collection > Aha - OK. The issue is PHP3? I've not pushed that as much - > if this code you're looking at is designed to run in PHP3, that > is a stronger possibility. > > As Jeremy wrote, PHP4 does indeed rock. Not had a problem yet > in nearly a year of production use. > > > jeremy brand wrote: > > > Yes, I've had php3 scripts that spiral linux into the ground and or > > core dump because of not being able to allocate memory (because it > > doesn't free it correctly). I would unset every variable I ever used, > > and it would still blow up. > > > > PHP4 rocks! I have none of these issues with PHP4, even without using > > unset. > > > > -jeremy brand > > _______________________________________________________________________ > > GnuPG Fingerprint: 9F5E 95E0 1CC2 E054 84EA 6099 8ACD 9DBA D2C0 5EA9 > > _ > > http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html for more > > __ > > > > On Fri, 3 Nov 2000, Michael Kimsal wrote: > > > > > Date: Fri, 03 Nov 2000 16:13:11 -0500 > > > From: Michael Kimsal <michael@tapinternet.com> > > > To: Dean Hall <hall@apt7.com> > > > Cc: php-general@lists.php.net > > > Subject: Re: [PHP] reference counting and garbage collection > > > > > > 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. > > > > > > > > > Dean Hall wrote: > > > > > > > I read something today from someone else's source that made me think. He > > > > said that since PHP uses reference counters, you need to 'unset' all your > > > > references before you exit your script. In particular, he was talking about > > > > an n-ary tree data structure he had made. He insisted in his comments that > > > > before the script ends, you call his cleanup method that goes through the > > > > entire tree and 'unset's all the references to parents and children. > > > > > > > > I'm worried about this, because I wrote an n-ary tree data structure as a > > > > navigation hierarchy for my website <http://www.apt7.com/src/NavNode.txt>. > > > > It uses references to keep track of its parent and its children. Do I need > > > > to unset these before script execution ends? Will I end up with memory > > > > leaks? I'm not familiar enough with the innards of PHP to know. > > > > > > > > Thanks to any brave enough to tackle this. > > > > Dean. > > > > > > -- > > > ========================== > > > Michael Kimsal > > > http://www.tapinternet.com > > > 734-480-9961 > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-general-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > -- > ========================== > Michael Kimsal > http://www.tapinternet.com > 734-480-9961 > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#23653) next »