There are two step – mark and sweep as name suggest.
Object has a mark bit at initial which is set to false (0).
In Mark stage – All REACHABLE object are marked as true and Unreachable still remain as false.
In Sweep stage – All Non Reachable (having mark bit as false) are cleared out from memory and remaining reachable object are marked as false again.
a)All the objects have their marked bits set to false at initial
b)Reachable objects are marked true
c)Non reachable objects are cleared from the heap. And rest reachable object are marked as false.