System.GC.Collect() forces garbage collector to run for managed code.
.NET Garbage collector does almost all clean up activity for your objects. But unmanaged
resources (ex: - Windows API created objects, File, Database connection objects, COM
objects etc) is outside the scope of .NET framework we have to explicitly clean our
resources. For these types of objects .NET framework provides Object.Finalize method
which can be overridden and clean up code for unmanaged resources
.NET Garbage collector does almost all clean up activity for your objects. But unmanaged
resources (ex: - Windows API created objects, File, Database connection objects, COM
objects etc) is outside the scope of .NET framework we have to explicitly clean our
resources. For these types of objects .NET framework provides Object.Finalize method
which can be overridden and clean up code for unmanaged resources