Garbage Collection in Circle

From: James Turner (turnerjh@XTN.NET)
Date: 04/20/98


I've recently been doing some reading on garbage collection in C
programs and have been pointed to a very interesting package.  I've
not downloaded or installed it yet, but it looks _very_ promising (and
has quite a few testimonials to its qualities).  The package is
written by Hans Boehm, and some information is available at
ftp://parcftp.xerox.com/pub/gc/ (the info is somewhat old, and there
is a link to newer information... which doesn't work).

For those unfamiliar with garbage collecting, basically it keeps track
of memory allocation, removing the need to worry about free()ing
blocks of memory when they are unused.  Some (including Boehm's) work
my using mark and sweep.  They trace through the stack, and all memory
allocations, and find all possible memory references.  They then
release any memory not pointed to.  This works very well because
memory is unneeded if there is no way to make references to it.

There is quite a bit of research, both theoretical and practical,
concerning the time/space tradeoffs of garbage collection (GC) versus
explicit memory management.  Effectively, GCing can compete in both
respects.  In particular, it can reduce code size and complexity by
eliminating the need to worry about memory management.

Boehm's package is, for all intents and purposes, a drop-in
replacement for malloc.  Basically you change calls to malloc to
GC_malloc, and remove calls to free.  I'm going to experiment over the
next few days on this and if anyone is interested, I'll report back.
Boehm's package supports a large number of environments -- at least as
many as Circle.  What are the chances of getting it incorporated into
Circle, should the powers that be deem it useful?

Chip

--
James Turner               turnerjh@xtn.net
                           http://www.vuse.vanderbilt.edu/~turnerj1/


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST