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
Differentiate between Server.Transfer and Response.Redirect with functionality? Why we can choose one over the other?
What is the maximum amount of memory any single process on windows can address?
What is fulltrust?
How can we add an event handler for a ASP.NET function executed on MouseOver for a certain button.
What do you mean by authorization?
How you can return View from ASP.NET Web API method?
If we remove web.config or machine.config from the application then, is this application will works?
What is postback in asp net?
What are server-side comments in ASP.NET?
What is autopostback true?
How to unit test Web API?
What is caching in asp.net?
What is the difference between “Web.config” and “Machine.Config”?
What tags do you need to add within the asp:datagrid tags to bind columns manually? Give an example.
How many types of session state management options available in asp.net?