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

what is entity sql?

822


How does servicing work for the .net framework 3.0? If I install the .net framework 3.0, can I get service updates for the .net framework 2.0?

751


How do you handle variable number of segments in a route definition?

758


What are the sub types of ActionResult?

830


What is .net architecture and framework?

810


What is viewdata?

789


explain what does .edmx file contains?

854


What is stateless model?

743


Is .net core faster than .net framework?

768


What are the 2 popular asp.net mvc view engines?

786


If we write any code for DataGrid methods, what is the access specifier used for that methods in the code behind file and why?

2263


Is .net core replacing .net framework?

717


How to answer for project questions..?

2446


What are Validation Annotations?

788


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

814