How does Garbage collector(GC) works in .net
Answer Posted / pradip kumar
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();
How it works :
Through 'Genaration Number' . CLR assigned this number for
each object so that GC can identify which one to be removed.
It can be 0,1,2 based upoon the
old/new/referenced/dereferenced criteria.
To check the space before and after GC.Collect() method use
GC.GetTotalMemory(true) method.
Regards,
Pradip kr Sen
Hyderabad
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
Explain difference betn dataset and recordset?
What is the Difference between MVC And MVP design pattrens
What are the new features implemented in ASP.NET?
What is the significance of ASP.NET routing?
How do I publish my asp.net application to my isp's web server?
What is redirecting behavior?
Explain what is event bubbling?
What is the difference between runtime version and version?
What is a web based system?
What is caching? Explain.
Asp pages that worked pefectly on windows 2000 server and iis 5.0 do not work on windows 2003 server with iis 6.0. Asp.net pages work fine. Why?
Explain the use of errorprovider control in .net?
What are url fragments?
What is difference between view state and session state?
What is the difference between ASP Session State and ASP.Net Session State?