Hi....
I want to know, when and how garbage collector run in .net? Please tell me anyone ?
Thanks.........
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pravin MorePosted Jan 10, 2012, 11:23 PM
Hi Vinit,
In .NET Garbage Collector maintained by CLR. The process of
GC is reclaim the memory of objets which is no longer
referenced by our program.Next thing is GC runs
undeterministicly because of that we can't assure we the
object will be released from the Heap Location.But the CLR
maintain a Logical Pointer to every object which referenced
by our program. In some amount of time the GC look out the
objects which is reachable from Logical Pointer. whatever
the object reachable from pointer it create a map those
objects. After that it will reclaim the memory of objects
those are not reachable from the pointer.This is the
process of how the GC clear the memory of Object.
Basically GC.Collect will work only if the memeory space is
less then required space.
You can force it to run by System.GC.Collect();
Thanks,
Pravin.
Vineet Kumar SainiPosted Jan 11, 2012, 1:29 AM
Satyapriya NayakPosted Jan 10, 2012, 11:37 PM
Please refer the below link
http://www.simple-talk.com/dotnet/.net-framework/understanding-garbage-collection-in-.net/
Thanks
Mukesh KumarPosted Jan 10, 2012, 11:11 PM
See these links:
http://www.c-sharpcorner.com/uploadfile/skumaar_mca/garbage-collection-in-net-framework/
http://msdn.microsoft.com/en-us/magazine/bb985010.aspx