What is garbage collection in .net? Explain the garbage collection process?



What is garbage collection in .net? Explain the garbage collection process?..

Answer / Abhinav Singh

Garbage Collection (GC) is a mechanism in .NET that automatically reclaims memory used by objects that are no longer in use. The process involves three main phases: 1) Garbage Collection (GC) - identifies and marks all live objects, 2) Rooting - finds the roots (variables still referencing these objects), and 3) Compacting - moves all live objects to free up memory for new ones.nnThe .NET garbage collector runs periodically or when memory usage exceeds a certain threshold. It's crucial for memory management in .NET applications.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net General Interview Questions

What are the contents of assembly?

4 Answers  


What is heap and what is stack?

1 Answers  


How to convert a .NET object into COM operabililty?

1 Answers   Petranics Solutions,


What is static constructor, when it will be fired?

1 Answers  


State the methods used during deserialization and serialization process.

2 Answers  


What is assembly in .net?

1 Answers  


What are server controls?

1 Answers   Avanade, Wipro,


What is jit compilers?

1 Answers  


What is 'Common Type System' (CTS) in .NET?

1 Answers   NA,


Please explain what is the difference between constants and read-only variables?

1 Answers  


What are two different types of remote object creation mode in .net?

1 Answers  


How can you automatically generate interface for the remotable object in .NET with Microsoft tools?

1 Answers  


Categories