How Garbage Collector identifies the objects which are not
in use?

Answer Posted / rahul veer

Garbage Collector determines which objects are no longer
being used by examining the application's roots. In Dot Net
each and every application has a set of roots. Each root
either refers to an object on the managed heap or is set to
null. An application's roots include global and static
object pointers, local variables and reference object
parameters on a thread's stack, and CPU registers. The
garbage collector has access to the list of active roots
that the just-in-time (JIT) compiler and the runtime
maintain. Using this list, it examines an application's
roots, and in the process creates a graph that contains all
the objects that are reachable from the roots. Objects that
are not in the graph are unreachable from the application's
roots. The garbage collector considers unreachable objects
as garbage and not in use.

Is This Answer Correct ?    10 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a view engine?

566


What is the mvc pattern (model view controller pattern)?

578


what is ssdl?

676


What happens when I install the .net framework 3.0? How can I upgrade if I already have the .net framework 2.0 installed?

525


What is the difference between tempdata and viewbag?

495






Can I add mvc testcases in visual studio express?

589


What is edm designer? : Entity framework

562


What is the use .glimpse in mvc?

588


How we can invoke child actions in ASP.Net MVC?

572


What is difference between Viewbag and Viewdata in ASP.NET MVC?

561


Explain Keep method in Tempdata in ASP.Net MVC?

562


What are the components of the .net framework.

571


Explain the advantages and disadvantages of ASP.Net MVC over ASP.NET?

530


What is Attribute Routing in ASP.Net MVC?

591


What is viewdata?

584