[gclist] gc interface
Bryan O'Sullivan
bos@serpentine.com
Fri, 22 Mar 1996 11:52:57 -0800 (PST)
d> I'm not sure it goes quite as far as you have in mind, but the
d> Glasgow Haskell system has several (4 ?) gcs that can be chosen at
d> build time.
Back when I was working on its gc, GHC had three collectors. One was
a very simple two-generation copying collector; another was a
compacting collector, based on Jonkers' algorithm. GHC requires the
heap size to be fixed in advance (the rationale behind this being that
programs with big space problems would bomb quickly rather than thrash
for hours, then bomb), so the third collector is a hybrid that
switches from copying to compacting collection when the semispaces
grow too full. Somebody (I think it might have been John Launchbury,
but I can't remember) worked for a while on a more complex
generational collector, but it never got finished.
d> The compiler is apparently parametrized (by C macros :-( ) so that
d> it isn't aware of the difference.
Something like that. In any case, you end up with as many gcs in the
runtime library as you ask for, and you can choose from those with a
switch when you start your program. The default collector is the
hybrid collector.
d> Last I heard, though, there was precious little documentation so
d> I'm not sure how general their approach is.
Not very. There are no runtime hooks to allow you to switch gcs, for
example, although since it is so hard to reason about memory usage in
a lazy functional program, such a facility probably wouldn't be any
help to anyone.
<b