Amazon Interview Question

Explain how Mark&Sweep is implemented.

Interview Answer

Anonymous

Jul 16, 2010

each object has an extra bit that is for marking. from main app each objects directly accessible are called "roots". from each root, mark process travers down the referencing and mark all the objects it can hit. when sweep process runs it checks all the objects and frees unmarked objects.