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 the .NET Framework the job of handling the process automatically for you. The garbage collector first checks for all objects that have references from your applications, including objects referenced from other objects, enabling object graphs to be kept alive. Objects ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.