by skybrian · 14y ago · 0 comments
Often this is combined with generational garbage collection - new objects live for a short time in a temporary area, and then if they are still in use (not garbage), they get copied to longer-term storage.
Wikipedia has a reasonable explanation of the basic algorithm:
http://en.wikipedia.org/wiki/Cheneys_algorithm
It probably gets more complicated if you try to share it with a non-copying collector, but the basic algorithm is very straightforward to implement.