Teacher starts the discussion: Managing memory is an important concern for programmers. But .NET tried to make their lives easier by taking the responsibility of clearing those objects that have no use after a particular point. In programming, we call them dirty objects or unreferenced objects.
The garbage collector program runs in background as a low-priority thread and keeps track of dirty objects
. .NET runtime on regular intervals can invoke this program to remove unreferenced or dirty objects from memory.
However, there is a catch. Some objects require special teardown codes ...