[racket] garbage collection and process idling
On Sat, Oct 16, 2010 at 07:24:42PM -0600, Matthew Flatt wrote:
> At Sat, 16 Oct 2010 13:40:43 -0400, Neil Van Dyke wrote:
> > Any thoughts on how, by default, timing of garbage collection cycles is
> > affected by whether the process is "idle".
> >
> > For example, if non-GC threads are all waiting on events, might the
> > thread with GC be more likely to trigger a GC at that idle time, rather
> > than when some threads are working?
>
> No.
>
> Eventually, we should improve the collector (or replace it with a
> better one) to support incremental collection. Then, it would be easy
> to use idle CPUs for GC work. Currently, though, if a GC is started,
> then the GC has to complete before anything else can happen, so a GC is
> triggered only by memory demand or explicit request.
This does mean it's worthwhile to explicitly request a garbage
collection when you expect to be idle for a perid of time.
But the system won't do this for you.
-- hendrik