adspace


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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the .net syntax for 'while loop'?

1143