- The garbage collector (GC) manages the allocation and release of memory in .NET framework.
- Garbage collection is one of the responsibilities of CLR only.
- Garbage collector will dispose this employee object automatically when it is no longer needed.
Garbage collection in C# operates transparently, allowing developers to
focus on writing code without manual memory management concerns. By
automatically reclaiming memory, GC helps prevent issues like memory
leaks and memory fragmentation, improving overall program stability and
performance.