©  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 
(1)
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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.