Register to Better Coder! It's free.
Enjoy the premium features and succeed at every job interview.

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?