Understanding Garbage Collection
In your applications you often create object instances or allocate memory for resources. When you perform these operations, .NET Framework checks for available memory in the heap. If available memory is not enough, .NET Framework launches a mechanism known as garbage collection, powered by an internal tool named garbage collector. The garbage collector can also be controlled by invoking members of the System.GC class, but the advantage is leaving .NET Framework the job of handling the process automatically for you. Basically the garbage collector first checks for all objects that have references from your applications, including objects referenced from other objects, enabling to keep alive object graphs. Objects ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access