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
What methods are fired during the page load? Init()
Explain the different types of assemblies?
Explain what are webservices?
What is the use of execute non query in asp.net?
how to write html code with ssl
What is the difference between Hash table and Array list?
What is the most appropriate lifetime for a database connection/orm context in an asp.net mvc application? : Asp.Net MVC
What is the difference between asp.net mvc and asp.net webforms? : asp.net mvc
What are different types of api?
if i wanna deploy my asp.net project to the production server and situation is that i m still not compiled my project i have as-is on my development side now on production server we dont have a visual studio now what kind of settings i need to be to do in webconfig /machine.config file to deploy my project and in iis too....
How to display validation messages in one control?
Explain the disadvantages of viewstate?
What is viewstate in asp net with example?
Explain the differences between clr & cts?
What is viewstate? In which event of the page life cycle, is the viewstate available?