user image

Preeti Tripathi

Job Interview Skills
English
2 years ago

Question 93. What Is Garbage Collection?

user image

Abhishek Mishra

2 years ago

Garbage collection is a CLR feature which automatically manages memory. Programmers forget to release the objects while coding. CLR automatically releases objects when they are no longer referenced and in use. CLR runs on non-deterministic to see the unused objects and cleans them. One side effect of this non-deterministic feature is that we cannot assume an object is destroyed when it goes out of the scope of a function. Therefore, we should not put code into a class destructor to release resources.

Recent Doubts

Close [x]