5
Reply

How to invoke garbage collector programmatically in c# ?

Hussain Ahmed

Hussain Ahmed

May 20, 2014
2.9k
0

    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 Shukla
    February 20, 2015
    1

    Using finalize or dispose

    Mukesh Kumar
    September 05, 2017
    0

    Mr.Hussain is right

    Bhabani Prasad
    May 23, 2014
    0

    Mr.Hussain is right

    Bhabani Prasad
    May 23, 2014
    0

    Call garbage collector programmatically, use code “ GC.Collect(); “

    Hussain Ahmed
    May 20, 2014
    0