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.
It's called periodically and automatically by the Common Language Runtime (CLR).
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.
Jignesh TrivediPosted Dec 18, 2013, 6:50 AM
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.
Jaganathan BantheswaranPosted Dec 18, 2013, 5:26 AM
Take a look here
Ahmar HusainPosted Dec 18, 2013, 5:13 AM
Satyapriya NayakPosted Dec 18, 2013, 4:47 AM
http://www.c-sharpcorner.com/UploadFile/ankithakur/GCAlgorithm12222005224854PM/GCAlgorithm.aspx
http://www.c-sharpcorner.com/UploadFile/puranindia/garbage-collection-in-C-Sharp/
VulpesPosted Dec 18, 2013, 4:46 AM
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.