[gclist] GC topics

David Chase chase@centerline.com
Tue, 20 Feb 96 16:13:34 EST


> From: creedy@mitre.org (Chris Reedy)
> I would like to use GC for business applications with GUIs.  However, the
> systems using GC with which I am personally familiar (e.g. Lisp) have the
> problem that a GC causes the GUI to stutter or hang and annoy the user.
> 
> My questions: To what extent is this a problem with GC in general as
> opposed to the specific implementation of GC?

Specific GC implementation(s).

> If this is a specific
> implementation problem, are products available that use or support GC
> (particularly for C or C++) that don't suffer from this problem? 

Yes.

Oh, I'll bet you wanted to know which ones.  I beleive that the Boehm-Weiser 
collector supports an incremental mode (on friendly OSes) that eliminates 
the stutter.  I'm reading (and writing) from within Postcard, a mail/news 
reading program written in Modula-3, and Modula-3 is garbage-collected, 
with a (default on) option to do incremental collection.  I've used 
it with non-incremental collection (because of a bug in SunOS 4.1.1 
that prevented use of the incremental collection) and there is a 
very big difference.  Essentially, the incremental collector works 
just fine.  Great Circle sells/supports a collector, I think a repackaging 
of the B-W collector on Unix, and something else on other platforms 
(See http://www.geodesic.com, or email sales@geodesic.com).  As a 
practical matter, if you're using Xt (X toolkit), then you should 
be using some sort of a garbage collector, because it leaks like 
a sieve (ever notice how a program that has run out of memory pauses
while it dumps core?).

There are other incremental techniques that ought to work just fine 
(Baker treadmill comes to mind) but since I have no first-hand experience 
using them, I can't say much.  The Boehm-Weiser collector works with 
C and C++, but I'd recommend Modula-3 instead, which comes with its
own collector, a nice set of libraries, and a comparatively thin 
language description.  Or, if you wish to be trendy, there's Java.

speaking for myself,

David Chase