From MSDN, GC is not just run when the program closes
Conditions for a garbage collection
Garbage collection occurs when one of the following conditions is true:
- The system has low physical memory.
- The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This threshold is continuously adjusted as the process runs.
- The GC.Collect method is called.
In almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing.