Came Across Very Good Pictorial Description of CMS Garbage Collection Stages which might in theory bit hard to understand.
CMS Collector has 5 phases for doing GC of Old Generation :
(Copied Selected Part from Oracle Tutorials without any modification)
CMS Collector operations step by step.
Heap Structure for CMS Collector
The heap is split into three spaces.
Young generation is split into Eden and two survivor spaces. Old generation is one contiguous space. Object collection is done in place. No compaction is done unless there is a full GC.
How Young GC works in CMS
The young generation is colored light green and the old generation in blue. This is what the CMS might look like if your application has been running for a while. Objects are scattered around the old generation area.
With CMS, old generation objects are deallocated in place. They are not moved around. The space is not compacted unless there is a full GC.
Young Generation Collection
Live objects are copied from the Eden space and survivor space to the other survivor space. Any older objects that have reached their aging threshold are promoted to old generation.
After Young GC
After a young GC, the Eden space is cleared and one of the survivor spaces is cleared.
Newly promoted objects are shown in dark blue on the diagram. The green objects are surviving young generation objects that have not yet been promoted to old generation.
Old Generation Collection with CMS
Two stop the world events take place: initial mark and remark. When the old generation reaches a certain occupancy rate, the CMS is kicked off.
(1) Initial mark is a short pause phase where live (reachable) objects are marked. (2) Concurrent marking finds live objects while the application continues to execute. Finally, in the (3) remark phase, objects are found that were missed during (2) concurrent marking in the previous phase.
Old Generation Collection - Concurrent Sweep
Objects that were not marked in the previous phase are deallocated in place. There is no compaction.
Note: Unmarked objects == Dead Objects
Old Generation Collection - After Sweeping
After the (4) Sweeping phase, you can see that a lot of memory has been freed up. You will also notice that no compaction has been done.
Finally, the CMS collector will move through the (5) resetting phase and wait for the next time the GC threshold is reached.
Reference : http://www.oracle.com/technetwork/tutorials/tutorials-1876574.html
CMS Collector has 5 phases for doing GC of Old Generation :
- Initial Mark (Stop the World Event).
- Concurrent Marking.
- Remark (Stop the World Event).
- Concurrent Sweep.
- Resetting.
(Copied Selected Part from Oracle Tutorials without any modification)
CMS Collector operations step by step.
Heap Structure for CMS Collector
The heap is split into three spaces.

Young generation is split into Eden and two survivor spaces. Old generation is one contiguous space. Object collection is done in place. No compaction is done unless there is a full GC.
How Young GC works in CMS
The young generation is colored light green and the old generation in blue. This is what the CMS might look like if your application has been running for a while. Objects are scattered around the old generation area.

With CMS, old generation objects are deallocated in place. They are not moved around. The space is not compacted unless there is a full GC.
Young Generation Collection
Live objects are copied from the Eden space and survivor space to the other survivor space. Any older objects that have reached their aging threshold are promoted to old generation.

After Young GC
After a young GC, the Eden space is cleared and one of the survivor spaces is cleared.

Newly promoted objects are shown in dark blue on the diagram. The green objects are surviving young generation objects that have not yet been promoted to old generation.
Old Generation Collection with CMS
Two stop the world events take place: initial mark and remark. When the old generation reaches a certain occupancy rate, the CMS is kicked off.

(1) Initial mark is a short pause phase where live (reachable) objects are marked. (2) Concurrent marking finds live objects while the application continues to execute. Finally, in the (3) remark phase, objects are found that were missed during (2) concurrent marking in the previous phase.
Old Generation Collection - Concurrent Sweep
Objects that were not marked in the previous phase are deallocated in place. There is no compaction.

Note: Unmarked objects == Dead Objects
Old Generation Collection - After Sweeping
After the (4) Sweeping phase, you can see that a lot of memory has been freed up. You will also notice that no compaction has been done.

Finally, the CMS collector will move through the (5) resetting phase and wait for the next time the GC threshold is reached.
Reference : http://www.oracle.com/technetwork/tutorials/tutorials-1876574.html