Garbage collector is a feature of CLR which cleans unused managed (it does not clean unmanaged objects) objects and reclaims memory. It’s a back ground thread which runs continuously and at specific intervals it checks if there are any unused objects whose memory can be claimed.
What is GAC?
GAC (Global Assembly Cache) is where all shared .NET assembly resides. GAC is used in the following situations:-
- If assemblies have to be shared among several application, which reside in the same computer.
- If the assembly has some special security, requirements like only administrators can remove the assembly. If the assembly is private then a simple delete of assembly the assembly file will remove the assembly.
Also see another .NET interview questions video on Garbage Collector, Gen 0, 1 & 2: -