previous      content      next
GC roots

The so-called GC (Garbage Collector) roots are objects special for garbage collector. Garbage collector collects those objects that are not GC roots and are not accessible by references from GC roots.

There are several kinds of GC roots. One object can belong to more than one root kind. The root kinds are:

  • Class - loaded class. Classes can hold other objects via their static fields.
  • Stack Local - local variable or parameter of method.
  • Finalizer Queue Entry - object scheduled for finalization.
  • GC Handle - provides a means for accessing a managed object from unmanaged memory.
  • Other - objects hold from garbage collection by CLR for other reasons.

If an object is a root, it is specially marked in all views showing individual objects. For example, the following picture shows a fragment of paths view:

previous      content      next