How many types of generations are there in a garbage collector?
How many types of generations are there in a garbage collector?
Answer
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.
Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website.
If you are using this website then its your own responsibility to understand the content of the website