Garbage Collection Basics:


When are the objects GCed?

When the garbage collector finds objects that can be reclaimed, it checks each object to determine the object's finalization requirements. If an object implements a finalizer and has not disabled finalization by calling SuppressFinalize, the object is placed in a list of objects marked as ready for finalization. The garbage collector calls the Finalize methods for the objects in this list and removes the entries from the list. This method blocks until all finalizers have run to completion.

Difference between Dispose(true) and Dispose(false)?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconimplementingdisposemethod.asp

Forcing GarbageCollection
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconforcingcollection.asp

Why I need to call WaitForPendingFinalizers?
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGCClassWaitForPendingFinalizersTopic.asp

Suppressing Garbage collection is explained here
http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemGCClassSuppressFinalizeTopic.asp

Jessica explains all this in one of her articles:
http://www.martnet.com/~jfosler/articles/UsingDispose.htm


Comments (2)

  1. .Net Adventures says:
  2. .Net Adventures says:
Skip to main content