abcprep.com - your onestop GMAT, GRE, PMP hub
.NET FAQs Unleashed!
 
    



    


Can garbage collector control the activities of a thread?

Garbage Collection - Garbage collection is a heap-management strategy where a run-time component takes responsibility for managing the lifetime of the memory used by objects. This concept is not new to .NET - Java and many other languages/runtimes have used garbage collection for some time. The garbage collector runs periodically. It runs through a list of objects that are currently being referenced by an application. All objects that it does not find during this search are ready to be destroyed (using the finalize method) and hence free the memory. However, the runtime gets notified of the object that has been destroyed, only in the next round of the garbage collector's periodic cycle.

In the class System.GC, there is a method called collect( ). This forces the garbage collector to collect all unreferenced objects immediately, thereby giving the developer some control over the garbage collector.

There is a gcConcurrent setting that can be set through the applications's .config file. This specifies whether or not the garbage collector performs its activities on a specified thread or not.

We can view the performance monitor to view the activities of the garbage collector.

.NET  Languages  Versions  Tools  CLI CTS Metadata CLS IL VES  CLR  Class Library  Managed Class  Assembly ILDASM  Reflection  Assembly Types  Strong Assembly  GAC  GC  IDisposable  Serialization  Code Access Security  Attribute  Thread  Globalization  Generations  COM 








Know Your Breath, Know Your Life!!!