What happens to the objects which survive a garbage collection?

What happens to the objects which survive a garbage collection?

New objects are created in generation 0. Those which survive first collection are moved to the generation 1, after second collection the survived objects are moved to the generation 2 and stay in that generation since the max number of generation supported by CLR is 2. In other words, the overall number of generations supported is 3 (0, 1 and 2)

Leave a Reply

Discover more from Abhyas

Subscribe now to keep reading and get access to the full archive.

Continue reading