on GUIs and such things
Jonathan S. Shapiro
Sun, 23 Jul 2000 13:47:10 -0400
> And you
> don't have to overwrite every unused pointer, just the top one which
> points to the entire substructure that is no longer needed. Most
> objects belong to something which belongs to something which ... belongs
> to a local variable in a method somewhere anyway. When the method exits,
> all the local variables and everything under them are garbage collected...
I don't recall the citations, but there have been good liveness studies done
on Lisp (perhaps it was Scheme). It proves that when a procedure call is
made, there are frequently dead temporary variables that point to extended
in-memory structures. Unfortunately, these are often stack allocated and the
garbage collector is unable to detect that they are dead variables. For
procedures that are relatively close to the beginning of the stack (i.e.
nearer to top-level), this is very bad.
Some compiler studies were done to add code to zero dead variables before
procedure calls. If I recall the paper I am thinking of correctly, the
resulting improvement in GC speed (by reducing live state) was something
better than 47%.