Interview questions

.Net - garbage collection

Next question>>           Learn .NET
.Net - Explain how garbage collection manages the reclamation of unused memory. - June 03, 2009 at 11:00 AM by Shuchi Gauri

Explain how garbage collection manages the reclamation of unused memory.

The garbage collector assumes that all objects in the managed heap are garbage. It starts walking the roots and builds a graph of all objects reachable from the roots recursively. It stops when it attempts to add an object to the graph that it previously added. The graph contains the set of all objects that are reachable from the application's roots. Any object/s that is not in the graph is not accessible by the application, and is considered garbage. Collection only occurs when the heap is full. In such a case, each and every garbage object calls the Finalize method and reclaims the unused memory.

Next question>>

Also read

What are circular references? Explain how garbage collection deals with circular references.

A circular reference is a run-around wherein the 2 or more resources are interdependent on each other rendering the entire chain of references to be unusable................

.NET Framework

What is a CLR (Common Language Runtime)?
Explain the concepts of CTS and CLS(Common Language Specification).
Explain the concepts and capabilities of Assembly in .NET
What is Manifest in .NET?
What is GAC in .NET?
What is garbage collection? How to force garbage collector to run?
Explain the different types of JIT in MS .NET..................

.NET garbage collection

What is garbage collection?
Is it possible to force garbage collection to run?
Define Dispose().
Explain how garbage collection manages reclamation of unused memory in .NET.
Explain how garbage collection deals with circular references..................

Define LeaseTime, SponsorshipTime, RenewOnCallTime, LeaseManagePollTime.

The LeaseTime property protects the object so that the garbage collector does not destroy it as remoting objects are beyond the scope of the garbage collector................. 



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring