Interviews5 answers
How to invoke garbage collector programmatically in c# ?
5 Answers
Using finalize or dispose
Mukesh KumarPosted Sep 5, 2017, 12:04 AM EDT
MyBigMemoryClass instance = GetMyInstance();
// Do something with instance
instance = null; // Unroot this, so there are (hopefully) no references to it left
GC.Collect(); // Collect everything
Shivam ShuklaPosted Feb 19, 2015, 9:51 PM EST
Mr.Hussain is right
Bhabani PrasadPosted May 22, 2014, 11:49 PM EDT
Mr.Hussain is right
Bhabani PrasadPosted May 22, 2014, 11:49 PM EDT
Call garbage collector programmatically, use code “ GC.Collect(); “
Hussain AhmedPosted May 20, 2014, 3:57 AM EDT



