How to invoke garbage collector programmatically in c# ?
Hussain Ahmed
MyBigMemoryClass instance = GetMyInstance(); // Do something with instance instance = null; // Unroot this, so there are (hopefully) no references to it left GC.Collect(); // Collect everything
Using finalize or dispose
Mr.Hussain is right
Call garbage collector programmatically, use code “ GC.Collect(); “