Contents    Page-10    Prev    Next    Page+10    Index   

Copying Garbage Collection

Another method of garbage collection is to divide the total address space of the machine into two halves. When storage is exhausted in one half, garbage collection occurs by copying all storage that is in use to the other half. Unused storage, by definition, doesn't get copied.

A copying collector uses time proportional to the amount of storage that is in use, rather than proportional to the address space. This is advantageous for programs that generate lots of garbage. Copying also tends to put list structures in nearby addresses, improving memory locality.

A copying collector has two disadvantages:

  1. Half the address space of the machine may be lost to Lisp use, depending on the implementation.

  2. There is a long period during which computation stops for garbage collection.