Memory management in the CLR is divided into three generations that are build up by grouping memory segments. Generations enhance the garbage collection performance. The following are the three types of generations found in a garbage collector:
Generation 0 - When an object is initialized, it is said to be in generation 0.
Generation 1 - The objects that are under garbage collection process are considered to be in generation 1.
Generation 2 - Whenever new objects are created and added to the memory, they are added to generation 0 and the old objects in generation 1 are considered to be in generation 2.
Generation 0 - When an object is initialized, it is said to be in generation 0.
Generation 1 - The objects that are under garbage collection process are considered to be in generation 1.
Generation 2 - Whenever new objects are created and added to the memory, they are added to generation 0 and the old objects in generation 1 are considered to be in generation 2.