The .NET Framework garbage collector manages the allocation and release of memory for applications.
When you create a new object the CLR allocates memory for the object in a managed heap.
The runtime continues to allocate space for new objects.
Because the memory is not infinite the garbage collector performs a collection in order to free some memory.
Advantages:
- don't have to free memory
- effectively allocate objects on the managed heap
- clears memory of the objects no longer being used
- memory safety