How to invoke Garbage Collector programmatically?

Experience Level: Senior
Tags: .NET

Answer

To call garbage collector from a program, use code GC.Collect();.

Comments

Anonymous
What are the cases when you really needed to call GC.Collect?