[Gc] Re: GC needs to be invoked manually

Martin Wartens martin.wartens at mymail.ch
Wed Aug 31 14:44:40 PDT 2005

> (The source as posted didn't work for me,
> due to bad line wrapping of // comments, and missing includes.
> I fixed it.  Apologies if I got this wrong.)

Ouch, you're right, I am sorry again for posting buggy code.

> The heuristics used by the collector are always debatable.  But in
> this case I think it's actually dead on.

I think this case is not different from the other: In both cases there is a 
large amount of uncollectable memory that is only destroyed by finalizing a 
collectable object. 
> It turns out this is already fixed in gc7.0alpha5, which uses a
> more robust heuristic.

What does it do?
> In general, this code is well outside the comfort zone for tracing
> collectors.  You really don't want a very large fraction of the
> objects to be finalizable (e.g. by inheriting from gc_cleanup),
> or reachable from finalizable objects.  Making all the objects
> collectable works MUCH better.

I agree that traceable_allocator/MALLOC_UNCOLLECTABLE is useful only in rare 
situations. What is so bad about gc_cleanup? Does finalization slow down the 


More information about the Gc mailing list