2 ms·
> One problem with garbage collection is that it needs to see the entire memory used by the program even if the program is not using big parts of it for anythin
by lispm 9y ago
> One problem with garbage collection is that it needs to see the entire memory used by the program even if the program is not using big parts of it for anything.
The first generational GC was proposed for Lisp in 1983. See Liebermann&Hewitt. The heap is divided into generations based on the lifetime of objects. Typically only the youngest generation, which is kept small, is scanned. This is based on the observation that a lot of objects are only short-lived. Thus a GC does typically does only need to look at a fraction of the memory.
Also GCs might want to use regions of similar objects. That way only those regions need to be looked at, which may free up space for an ohject that wants to be allocated currently.