Explain how garbage collection manages reclamation of unused memory in .NET.CLR performs garbage collection on small objects and large objects separately. It maintains separate heaps for these two types of objects. Large Objects are maintained in LO
Heap and small objects are kept in multiple heaps which are compacted regularly.
It uses the JIT compiler which provides it the references of live objects indicating that they are alive. The rest of the objects are then subject to garbage collection.
Then the free memory is merged and the occupied memory is compacted so that the live objects are contiguous.
|