Jump to content

Mark–compact algorithm

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jkl (talk | contribs) at 09:56, 4 March 2007 (Created page with 'The '''mark-compact algorithm''' is an garbage collection algorithm used to reclaim unreachable memory. It can be ...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

The mark-compact algorithm is an garbage collection algorithm used to reclaim unreachable memory. It can be regarded as a hybrid of the mark-sweep algorithm and Cheney's copying algorithm. First, reachable objects are marked, then a compacting step relocates the reachable (marked) objects towards the beginning of the heap area. Compacting garbage collection is used by Microsoft's Common Language Runtime.