Re: reference counting and garbage collection
| From: | jeremy brand | Date: | Fri, 03 Nov 2000 21:26:06 +0000 |
| Subject: | Re: reference counting and garbage collection | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-23643@lists.php.net to get a copy of this message | ||
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
>
>