[gclist] GC triggering strategies
Paul R. Wilson
wilson@cs.utexas.edu
Mon, 18 Mar 1996 23:15:37 -0600
>From majordom@iecc.com Mon Mar 18 19:06:50 1996
>A more general question: Are there any good general adaptive heuristics
>for triggering a GC?
Glib answer: there aren't any good *general* *adaptive* heuristics for
anything. :-)
Seriously, this kind of thing is *in general* application dependent.
If you know your app, you can force GC at the right times. (This has
been done forever, using various nonportable GC hooks.)
More generally, I think a good approach may be to give hints to the
GC, like nested phase delimiters. Then the GC can take its own
knowledge into account to decide when to GC. (For example, for deciding
when to GC the youngest generation, boundaries of small phases may or
may not be the right place to GC; the GC can decide based on the
actual size of the youngest generation. If the youngest genration
is big relative to the small phases, it may trigger off the next
larger granularity of phases.)
It's hard for programmers to directly control a GC, and it's hard
for a GC to infer reliably about programs, but a middle-level
interface seems likely to work with minimal programmer help
in a lot of circumstances.