This documentation is archived and is not being maintained.
GC Methods
Visual Studio 2010
The GC type exposes the following members.
| Name | Description | |
|---|---|---|
|
AddMemoryPressure | Informs the runtime of a large allocation of unmanaged memory that should be taken into account when scheduling garbage collection. |
|
CancelFullGCNotification | Cancels the registration of a garbage collection notification. |
|
Collect() | Forces an immediate garbage collection of all generations. |
|
Collect(Int32) | Forces an immediate garbage collection from generation zero through a specified generation. |
|
Collect(Int32, GCCollectionMode) | Forces a garbage collection from generation zero through a specified generation, at a time specified by a GCCollectionMode value. |
|
CollectionCount | Returns the number of times garbage collection has occurred for the specified generation of objects. |
|
GetGeneration(Object) | Returns the current generation number of the specified object. |
|
GetGeneration(WeakReference) | Returns the current generation number of the target of a specified weak reference. |
|
GetTotalMemory | Retrieves the number of bytes currently thought to be allocated. A parameter indicates whether this method can wait a short interval before returning, to allow the system to collect garbage and finalize objects. |
|
KeepAlive | References the specified object, which makes it ineligible for garbage collection from the start of the current routine to the point where this method is called. |
|
RegisterForFullGCNotification | Specifies that a garbage collection notification should be raised when conditions favor full garbage collection and when the collection has been completed. |
|
RemoveMemoryPressure | Informs the runtime that unmanaged memory has been released and no longer needs to be taken into account when scheduling garbage collection. |
|
ReRegisterForFinalize | Requests that the system call the finalizer for the specified object for which SuppressFinalize has previously been called. |
|
SuppressFinalize | Requests that the system not call the finalizer for the specified object. |
|
WaitForFullGCApproach() | Returns the status of a registered notification for determining whether a full garbage collection by the common langauge runtime is imminent. |
|
WaitForFullGCApproach(Int32) | Returns, in a specified time-out period, the status of a registered notification for determining whether a full garbage collection by the common language runtime is imminent. |
|
WaitForFullGCComplete() | Returns the status of a registered notification for determining whether a full garbage collection by the common language runtime has completed. |
|
WaitForFullGCComplete(Int32) | Returns, in a specified time-out period, the status of a registered notification for determining whether a full garbage collection by common language the runtime has completed. |
|
WaitForPendingFinalizers | Suspends the current thread until the thread that is processing the queue of finalizers has emptied that queue. |
Show: