Interviews - C# Corner

Hussain Ahmed
How to invoke garbage collector programmatically in c# ?
By Hussain Ahmed in .NET onMay 20 2014
  • Shivam Shukla
    Feb, 2015 20

    MyBigMemoryClass instance = GetMyInstance(); // Do something with instance instance = null; // Unroot this, so there are (hopefully) no references to it left GC.Collect(); // Collect everything

    • 1
  • Mukesh Kumar
    Sep, 2017 5

    Using finalize or dispose

    • 0
  • Bhabani Prasad
    May, 2014 23

    Mr.Hussain is right

    • 0
  • Bhabani Prasad
    May, 2014 23

    Mr.Hussain is right

    • 0
  • Hussain Ahmed
    May, 2014 20

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

    • 0

Most Popular Companies

Most Popular Job Functions

MOST LIKED QUESTIONS