Garbage collector
who will call gc?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Dec 17, 2013, 11:46 PM EST
It's generally best to leave the CLR to do this in its own time. However, you can force an immediate garbage collection by calling the GC.Collect method.
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 17, 2013, 11:47 PM EST
http://www.c-sharpcorner.com/UploadFile/ankithakur/GCAlgorithm12222005224854PM/GCAlgorithm.aspx
http://www.c-sharpcorner.com/UploadFile/puranindia/garbage-collection-in-C-Sharp/
Ahmar HusainRank #1,312 · 1.3K reputationPosted Dec 18, 2013, 12:13 AM EST
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Dec 18, 2013, 12:26 AM EST
Take a look here
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 18, 2013, 1:50 AM EST
Hi,
As per my knowledge, GC is not running continuously. whenever any .net program trying to allocate memory in managed heap and there is no enough free memory to create new object at this time GC will collect memory object which is already out of scoped.
Please refer
http://msdn.microsoft.com/en-us/magazine/bb985010.aspx
hope this will help you.