I heard that C# does not free memory right away even if you are done with it. Can I force C# to free memory?
I am using Visual Studio 2008 Express. Does that mat
You can't force C# to free memory, but you can request that the CLR deallocates unreferenced objects by calling
System.GC.Collect();
There is a method WaitForPendingFinalizers that will "suspend the current thread until the thread that is processing the queue of finalizers has emptied that queue." Though you shouldn't need to call it.
As the others have suggested head over to the MSDN for more information.