[plt-scheme] Garbage collection woes

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Fri Nov 9 08:03:02 EST 2007

At Fri, 9 Nov 2007 01:18:30 -0500, "Henk Boom" wrote:
> With my limited knowledge of garbage collector implementation, I would
> think that a fix as simple as only moving objects to mature space
> after they survive X number of nursery collections would help this
> tremendously.

As an experiment, you might try building with the "compact" 3m
collector, which uses 4 or 5 generations instead of just two (nursery
and mature). Under Unix variants, building with the compact collector
is as easy as configuring with the --enable-compact option. For a
Windows build, change the definition `(define accounting-gc? #t)' to #f
in the file "plt/src/worksp/gc2/make.ss".

The "compact" collector is different in many ways from the default one,
so it's not a great test for whether multiple generations can help.
Unfortunately, changing the default collector to use multiple
generations is not so easy.

> P.S.: I suppose having the program be able to ask that mzscheme permit
> it to use more memory before collecting would help as well. I know
> that the smarteiffel compiler had three memory modes, one of which
> would try to keep the memory usage low, one which kept it at
> reasonable levels, and one which would gobble memory until it actually
> ran out before collecting.

Since the collector bases its nursery size on the amount of memory
already allocated, you can partially simulate this (without rebuilding
the binaries) by allocating a large string at the beginning of your
program.

I agree with the idea of making more of the knobs dynamic and making
them more available.

Matthew



Posted on the users mailing list.