What is the Garbage Collector in .NET Framework?
Experience Level: Medior
Tags: .NET
Answer
In .NET Framework the Garbage Collector is responsible for memory management - alocation and release of memory.
When an application creates a new instance of an object, the common language runtime (CLR) automatically allocates memory on the managed heap.
Later, when the object is released, the memory is no longer needed and it needs to be reclaimed for the future use. The process of reclaming unused memory is called garbage collection and it is taken care of by the Garbage Collector.
Related .NET job interview questions
What is the Managed Code?
.NET JuniorHow to invoke Garbage Collector programmatically?
.NET SeniorWhat is Common Language Specification (CLS)?
.NET SeniorWhat is common Type System (CTS)?
.NET SeniorWhat is Common Language Runtime (CLR)?
.NET Not defined