Types of generations in garbage collector

Explain different types of generations in a garbage collector?

E

Expert

Verified

Memory management in CLR gets divided in three generations which are build up by grouping various memory segments. These generations enhances the performance of garbage collection.

Following are three types of generations which is found in the Garbage collector:

a) Generation 0 - When an object is initialized, it is termed to be in generation 0.

b) Generation 1 - The objects that are under the process of garbage collection are considered to be in generation 1.

c) Generation 2 – When new objects are created and added to memory, they are included in the generation 0 and old objects in the generation 1 are considered to be in the generation 2.

   Related Questions in DOT NET Programming

©TutorsGlobe All rights reserved 2022-2023.