Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

GC::Collect Method

 

Forces garbage collection.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

NameDescription
System_CAPS_pubmethodSystem_CAPS_staticCollect()

Forces an immediate garbage collection of all generations.

System_CAPS_pubmethodSystem_CAPS_staticCollect(Int32)

Forces an immediate garbage collection from generation 0 through a specified generation.

System_CAPS_pubmethodSystem_CAPS_staticCollect(Int32, GCCollectionMode)

Forces a garbage collection from generation 0 through a specified generation, at a time specified by a GCCollectionMode value.

System_CAPS_pubmethodSystem_CAPS_staticCollect(Int32, GCCollectionMode, Boolean)

Forces a garbage collection from generation 0 through a specified generation, at a time specified by a GCCollectionMode value, with a value specifying whether the collection should be blocking.

System_CAPS_pubmethodSystem_CAPS_staticCollect(Int32, GCCollectionMode, Boolean, Boolean)

Forces a garbage collection from generation 0 through a specified generation, at a time specified by a GCCollectionMode value, with values that specify whether the collection should be blocking and compacting.

Return to top
Show:
© 2017 Microsoft