Well, I assume that they would already ditch reference counting for a better solution if they could. But definitely a php function to purge those objects would be useful.
Meanwhile, it's probably better to avoid cyclic references or provide some sort of clean up mechanism for the code using it. Anyway I would be much happier too if php could handle it by itself. Cheers Karol Pepa wrote: > > Hi Karol, > > It is possible to solve it in the PHP code ... > But from my point of view, it would be much more reasonable if the PHP > supports such cleaning itself. Actually if you have to make cleaning of > variables > that are not in the global context, what is the autmatic memory cleaning > good for? > Personally I would expect that PHP itself supports something like method: > memory_clean(); > Where all the memory nodes inaccessible from the script are thrown away. > So far > as I understand it, the PHP doesn't do this beacuse of time efficiency, > but if this thing > isn't performed always but only when such method is called, it will be > much better. > Actually it is just question of time when the more and more complicated > objects will face this > problem again. And I'm sure that as the framework is evolving, the classes > won't be "simple". > (and the PDF is good example). And we will need to implement something > like finalization in Java > on our own again and again... > IMHO when PHP supports classes and objects, it should also offer some > reasonable memory > managment. > However I agree with your idea while the PHP doesn't do that itself. > Perhaps we should ask > for feature in PHP :) > > Best Regards, > Josef Pihera. > > > Karol Grecki wrote: >> >> Hi Josef, >> >> Your measurement is correct. It's pretty obvious what's happening. >> >> If in your code you'd make explicit call to unset($this->b), perhaps in a >> separate method like: >> >> $a = new a(); >> $a->clean(); >> >> The problem is gone. Maybe the same can be done for Zend_Pdf. There would >> be a cleanup mechanism that can be called explicitly in cases where it's >> really needed? >> >> Cheers >> Karol >> >> >> Pepa wrote: >>> >>> I hope that anybody who will read this will try if I am right (I hope I >>> am not...), maybe >>> my memory measuring is wrong, or it is just my pc-config dependent. >>> >>> Best regards, >>> Josef Pihera. >>> >> >> > > -- View this message in context: http://www.nabble.com/Schedule-for-ZF-1.0.0-RC3-tf3934133s16154.html#a11176237 Sent from the Zend Framework mailing list archive at Nabble.com.
