BCL mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00 ] 1.0.5000.0 2.0.0.0 4.0.0.0 All public static members of this type are safe for multithreaded operations. No instance members are guaranteed to be thread safe. System.Object

Provides a mechanism for programmatic control of the garbage collector.

The is responsible for tracking and reclaiming objects allocated in managed memory. Periodically, the garbage collector performs a garbage collection to reclaim memory allocated to objects for which there are no valid references. Garbage collections happen automatically when a request for memory cannot be satisfied using available free memory.

A garbage collection consists of the following steps:

The garbage collector searches for managed objects that are referenced in managed code.
The garbage collector attempts to finalize unreferenced objects.
The garbage collector frees unreferenced objects and reclaims their memory.

During a collection, the garbage collector will not free an object if it finds one or more references to the object in managed code. However, the garbage collector does not recognize references to an object from unmanaged code, and can free objects that are being used exclusively in unmanaged code unless explicitly prevented from doing so. The method provides a mechanism that prevents the garbage collector from collecting objects that are still in use in unmanaged code.

Implementations of the garbage collector should track the following information:

Memory allocated to objects that are still in use
Memory allocated to objects that are no longer in use
Objects that require finalization prior to being freed

Other than managed memory allocations, implementations of the garbage collector should not maintain information about resources held by an object, such as file handles or database connections. When a type uses unmanaged resources that must be released before instances of the type are reclaimed, the type should implement a

. In most cases, finalizers are implemented by overriding the method; however, types written in C# or C++ implement destructors, which compilers turn into an override of .

In most cases, if an object has a finalizer, the garbage collector calls it prior to freeing the object. However, the garbage collector is not required to call finalizers in all situations. Also, the garbage collector is not required to use a specific thread to finalize objects, or guarantee the order in which finalizers are called for objects that reference each other but are otherwise available for garbage collection.

In scenarios where resources must be released at a specific time, classes should implement the interface, which contains a single method () that is used to perform resource management and cleanup tasks. Classes that implement must specify, as part of their class contract, if and when class consumers call the method to clean up the object. The garbage collector does not, by default, call the method; however, implementations of the method can call methods in the class to customize the finalization behavior of the garbage collector.

- Method
  System.Void `` To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  4.0.0.0
  System.Void To be added. To be added.
- Method
  System.Void

  Requests that the garbage collector reclaim memory allocated to objects for which there are no valid references.

  A call to this method is only a suggestion; such a call does not guarantee that any inaccessible memory is, in fact, reclaimed.

  1.0.5000.0
  2.0.0.0
  4.0.0.0
- Method
  System.Void `` To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Method
  System.Int32 `` To be added. To be added. To be added. To be added. 2.0.0.0 4.0.0.0 System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
- Method
  System.Int32 `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Int32 `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Int64 `` To be added. To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` A that is not to be reclaimed by the garbage collector.

  Creates a reference to the specified object.

  The purpose of the method is to ensure the existence of a reference to an object that is at risk of being reclaimed by the garbage collector prematurely.

  The method performs no operations and does not produce any side effects.

  This method is required to be implemented in such a way as to prevent optimizing tools from omitting the method call from the executable code.

  During program execution, after the call to the method is executed, if there are no additional references to in managed code or data, is eligible for garbage collection.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
- Property
  System.Int32 To be added. To be added. To be added. 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  4.0.0.0
  System.Void `` `` To be added. To be added. To be added. To be added.
- Method
  System.Void `` To be added. To be added. To be added. 2.0.0.0 4.0.0.0
- Method
  System.Void `` The to add to the set of objects that require finalization.

  Requests that the specified object be added to the list of objects that require finalization.

  The method adds to the list of objects that request finalization before the garbage collector frees the object. is required to be the caller of this method.

  Calling the method does not guarantee that the garbage collector will call an object's finalizer. For more information, see .

  By default, all objects that implement finalizers are added to the list of objects that require finalization; however, an object might have already been finalized, or might have disabled finalization by calling the method.

  is a reference. The caller of this method is not the same as the object passed to this method. 0 1.0.5000.0 2.0.0.0 4.0.0.0
- Method
  System.Void `` The whose method will not be called.

  Instructs the garbage collector not to call the method on the specified object.

  The method removes from the set of objects that require finalization. is required to be the caller of this method.

  Objects that implement the interface should call this method from the method to prevent the garbage collector from calling on an object that does not require it.

  is a reference. The caller of this method is not the same as the object passed to this method. 0 1.0.5000.0 2.0.0.0 4.0.0.0 System.Runtime.ConstrainedExecution.ReliabilityContract(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)
- Method
  4.0.0.0
  System.GCNotificationStatus To be added. To be added. To be added.
- Method
  4.0.0.0
  System.GCNotificationStatus `` To be added. To be added. To be added. To be added.
- Method
  4.0.0.0
  System.GCNotificationStatus To be added. To be added. To be added.
- Method
  4.0.0.0
  System.GCNotificationStatus `` To be added. To be added. To be added. To be added.
- Method
  System.Void

  Suspends the current thread until the set of objects waiting for finalization is empty.

  blocks an application until all objects that are awaiting finalization have been finalized.

  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 , the object is passed to the thread that handles finalization. The

  method blocks until all finalizers have run to completion.

  0
  1.0.5000.0
  2.0.0.0
  4.0.0.0
0