©  Konrad Kokosa 2018
Konrad KokosaPro .NET Memory Managementhttps://doi.org/10.1007/978-1-4842-4027-4_8

8. Garbage Collection - Mark Phase

Konrad Kokosa1 
Warsaw, Poland

In the previous chapter we have gained knowledge about some general GC topics, like when it is triggered and how it decides which generation should be collected. Let’s now move into the details of implementation of the first main GC phase - Mark phase.

At this stage, GC decided which generations will be collected. It’s time to investigate which objects may be reclaimed. As mentioned before, CLR implements a tracing Garbage Collector. It starts from various roots and recursively traverses a whole object’s graph of the current program state. All those that are not reachable from ...

Get Pro .NET Memory Management: For Better Code, Performance, and Scalability now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.