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: