Boost logo

Boost :

From: John Max Skaller (skaller_at_[hidden])
Date: 2001-05-25 15:10:22


Larry Evans wrote:
> I'm also thinking of raising the issue of why
> Boehm's collector shouldn't be used. The only reason I can think
> of is the remote possiblity of misidentifying pointers.

        No. That isn't the reason. While it is a problem
that some objects may accidentally fail to be finalised
when Boehm accidentally decides that the object is
reachable, a far more significant reason is that
Boehm will delete objects which in fact ARE reachable,
namely, objects for which the pointers are no longer
held in main memory, but have been grabbed by an
external interface.

        Using Boehm, you can register these objects
as roots, and unregister them. But that defeats the
principal advantage of Boehm, namely, transparency.

        A second problem with Boehm is that it is global,
and as such uses 'world stop' collection. In particular,
it stops the whole process to do collection, which
is very nasty in a muli-threaded environment.
Last time I looked, there was no portable way to find the stacks
of each thread (and Boehm was hassling the Posix people to
fix that).

        The other major problem is performance.
Boehm is very space efficient compared to Felix GC.
However, exact collectors (such as Felix) ought to be MUCH faster,
since they only examine known pointers, these are assumed
to point _at_ (rather than possibly _into_) objects,
for manual collectors, not all objects are
scanned, and, for instance based collectors, scans only
cover subsets of memory.

        More interesting: once you agree to do 'manual'
collection, you might go further and be prepared to
use a generational collector. These are MUCH faster,
since the minor cycles only scan recently allocated
memory, but the cost is that you cannot simply
store pointer values into variables (you have to tell
the collector every time you write a pointer).

        Generational collectors work well with functional
programming languages where writes are impossible :-)

-- 
John (Max) Skaller, mailto:skaller_at_[hidden]
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk