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
Describe a Windows Service and its lifecycle ?
How can we apply themes to an asp.net application?
What is the importance of Global.asax in ASP.NET?
What does ascx stand for?
List down the sequence of methods called during the page load.
Define web.config in .net?
What is master page in dtp?
Explain Areas in MVC?
Explain the main function of url routing system in asp.net mvc? : asp.net mvc
What are HTTP handlers in ASP.NET?
What is asp.net futures?
Is post back property in asp net?
How do you initiate validation on the server manually? What are two situations when you might you want to do that?
Why the javascript validation not run on the asp.net button but run successfully on the html button?
Define a web service in .net?