Ziisoft Nano Technologies Interview Question
- 0of 0 votes
AnswersWhat is a Garbage Collector?
- hr@ziitech.com February 10, 2022 in United States
Ans: Garbage collection is a .Net feature to free the unused code objects in the memory.
The memory heap is divided into three generations. Generation 0, Generation 1 and Generation 2.
• Generation 0 – This is used to store short-lived objects. Garbage Collection happens frequently in this Generation.
• Generation 1 – This is for medium-lived objects. Usually, the objects that get moved from generation 0 are stored in this.
• Generation 2 – This is for long-lived objects.
Collecting a Generation refers to collecting the objects in that generation and all its younger generations. Garbage collection of Generation 2 means full garbage collection; it collects all the objects in Generation 2 as well as Generation 1 and Generation 0.| Report Duplicate | Flag | PURGE
Ziisoft Nano Technologies .Net/C