Why doesn't the .NET runtime offer deterministic destruction

Answer Posted / kirti

Because of the garbage collection algorithm. The .NET garbage collector works by periodically running through a list of all the objects that are currently being referenced by an application. All the objects that it doesn't find during this search are ready to be destroyed and the memory reclaimed. The implication of this algorithm is that the runtime doesn't get notified immediately when the final reference on an object goes away - it only finds out during the next sweep of the heap.

Futhermore, this type of algorithm works best by performing the garbage collection sweep as rarely as possible. Normally heap exhaustion is the trigger for a collection sweep.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have 2+ years of fake experience,actually i could not answer for project questions..?how can i answer please suggest me..?

2633


What is the .net framework?

562


What is .net framework & its benefits?

505


What is associationset? : Entity framework

551


What is tempdata?

602






What is entity graph? : Entity framework

516


What are the components required to create a route in ASP.Net MVC?

573


What is Layout in ASP.Net MVC?

562


What is meant by domain model?

525


why DotNetFramework is included in building a software

2195


What is the importance of NonActionAttribute?

597


what is linq to entities?

622


What is session state management?

549


mention in what all scenarios entity framework can be applicable?

954


What is route config?

543