-----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.