次の方法で共有


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)?
https://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconimplementingdisposemethod.asp

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

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

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

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

Comments