After all cells that are in use have been marked, the Sweep phase is run. All memory cells are examined, in order of increasing address. Unmarked cells are added to the Free List.
``Marking'' a cell may use an available bit within the cell, or it may use a separate bit table that uses one bit to represent each word.
Mark-and-Sweep garbage collection is conceptually simple. However, it requires time that is proportional to the size of the address space, independent of how much garbage is collected. This is a disadvantage for large address spaces.
Another disadvantage of this algorithm is that all computation stops for several seconds while garbage is being collected. This is not good for real-time applications, e.g., a robot walking down stairs.
Contents    Page-10    Prev    Next    Page+10    Index