Calling <code>GC.Collect</code> is rarely necessary, and can significantly affect application performance. That's because it triggers a blocking operation that examines _every object in memory_ for cleanup. Further, you don't have control over when this blocking cleanup will actually run.

As a general rule, the consequences of calling this method far outweigh the benefits unless perhaps you've just triggered some event that is unique in the run of your program that caused a lot of long-lived objects to die.

This rule raises an issue when <code>GC.Collect</code> is invoked.

== Noncompliant Code Example

----
static void Main(string[] args)
{
  // ...
  GC.Collect(2, GCCollectionMode.Optimized); // Noncompliant
}
----
