AW: [PHP-DEV] Re: [RFC] Magic Method that handles unset($object)
| From: | Matthias Pigulla | Date: | Mon, 11 Dec 2006 09:11:56 +0000 |
| Subject: | AW: [PHP-DEV] Re: [RFC] Magic Method that handles unset($object) | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-26896@lists.php.net to get a copy of this message | ||
> -----Ursprüngliche Nachricht-----
> Von: Ants Aasma [mailto:ants.aasma@gmail.com]
> That would indeed be too slow. The standard way to handle
> this, is to only check visibility periodically. That is how
> Java, .NET, Python and countless others do that. Check
> http://www.hpl.hp.com/personal/Hans_Boehm/gc/ for a sample of
> how an implementation might look like.
The whole issue comes up regularly on various lists, e. g. Propel or Phing suffer from it. Also see
http://bugs.php.net/bug.php?id=33595. Working
around this in userland may be possible but is at least painful and messy.
If the only problem is that detection is slow, wouldn't it be possible to add a gc_cleanup()
function that performs the scan? Those who use PHP in a request/response environment need not care
(everything is freed at the end of the request). Those who don't and hit the problem regularly
will find a good place to make this call and certainly won't complain about the delay.
mp.