Re: "waldschrotts guide to nifty references" - manual pagedraft, version 0.9b

From: Date: Sun, 20 Aug 2000 05:56:28 +0000
Subject: Re: "waldschrotts guide to nifty references" - manual pagedraft, version 0.9b
References: 1  Groups: php.dev php.qa 
Request: Send a blank email to php-dev+get-29951@lists.php.net to get a copy of this message
At 08:40 20/08/2000, Stanislav Malyshev wrote:
RC>> The use of circular references causes memory leaks which may be RC>> cleaned up after each request in same cases (the more complex, RC>> the greter likelyhood of a leak), This is intended and should RC>> not hurt unless you´re using extremely large objects, or having RC>> many concurrent scripts running. I won't mention this in the manual. At least, not the leaks. This doesn't look good, like "they have a bug and are too lazy to correct it". And if we start explaining why is that leak and when it happens (which I personally don't exactly know) and what to do with them - we'll have entire article of reference counting systems there.
I wouldn't mention this at all. I'll state it again, loud and clear, that references were *not* designed to enable you to create recursive data structures, and they perform very badly for this purpose. The leakage issue can be very serious - for instance, a leaking data structure that leaks 30 bytes, can end up leaking megabytes if it's put in a loop. Fact is, if there was a way to prevent recursive data structures from even being implemented, I would have done my best to implement it. Unfortunately there isn't, so you can still do it, even though you're strongly encouraged not to. Not mentioning it to the average end user is a must. Note that I have every reason to believe that this behavior is here to stay with us forever. For the 'what'll be in PHP 5' kind of questions, I can say that I'm pretty sure that PHP 5 isn't going to include a scripting engine rewrite. Zeev -- Zeev Suraski <zeev@zend.com> http://www.zend.com/

« previous php.dev (#29951) next »