Session Initiation Protocol for Business

Why Trust Techopedia

What Does Session Initiation Protocol for Business Mean?

Garbage collection, in the context of .NET, is the process by which the common language runtime (CLR) of .NET framework manages the memory by allocating and releasing memory automatically.


Garbage collector of .NET tries to compact the memory in such a way as to increase the working space required for heap. The class GC of .NET class library controls the garbage collector. The core task of performing a collection is executed by the GC’s optimizing engine that determines the best time to perform collection based on allocations being made. GC runs are non-deterministic since the call to GC cannot be guaranteed. However, explicit calls to the overloaded 'Collect()' method of the class GC can be used whenever needed.

The advantages that GC provides include:

  • the elimination of memory de-allocation code in applications
  • optimized memory usage in managed heap
  • clearing up of memory of reclaimed objects that are no longer in use (which helps to initialize managed objects allocated in future and provision of memory safety of objects to avoid an object using content of another.)

Techopedia Explains Session Initiation Protocol for Business

GC manages the virtual memory on the managed heap, which is the memory segment used to store and manage objects created in a managed process. If an object does not have any reference and cannot be reached or used, it becomes garbage. While GC performs a collection in a separate thread, all unusable objects are enumerated and the memory allocated to them is reclaimed.

Garbage collection is executed in situations such as when the system having low physical memory or where memory allocated in managed heap exceeds acceptable threshold value. Since the GC is executed periodically, there is generally no need to call the GC.Collect() method.

The two options in which GC can be configured to specify the way by which the CLR need to perform are 1) workstation and, 2) server garbage collection. The key difference between the two is that the former occurs in the user thread that triggered the GC whereas the latter occurs on threads running at highest priority level. Also, workstation GC is always used on a system having single processor while the server GC is resource intensive with larger size segments and used in systems with multiple processors.

The two types of possible collections are full and partial types. A full collection is executed by stopping the program execution and visiting every object, following its object pointer and marking the object as reachable (or live) or unreachable (or condemned). After visiting the objects, the memory of the unreachable objects is reclaimed and the living objects are slided so the memory allocated is contiguous without any waste space in between. Partial collection searches only a part of heap and is used when full collection is found to be expensive.

The limitation of GC is that it does not release the unused objects that are still referenced, which can cause memory leaks.


Related Terms

Margaret Rouse

Margaret jest nagradzaną technical writerką, nauczycielką i wykładowczynią. Jest znana z tego, że potrafi w prostych słowach pzybliżyć złożone pojęcia techniczne słuchaczom ze świata biznesu. Od dwudziestu lat jej definicje pojęć z dziedziny IT są publikowane przez Que w encyklopedii terminów technologicznych, a także cytowane w artykułach ukazujących się w New York Times, w magazynie Time, USA Today, ZDNet, a także w magazynach PC i Discovery. Margaret dołączyła do zespołu Techopedii w roku 2011. Margaret lubi pomagać znaleźć wspólny język specjalistom ze świata biznesu i IT. W swojej pracy, jak sama mówi, buduje mosty między tymi dwiema domenami, w ten…