Thursday, 4 September 2014

Garbage Collector (GC)

Garbage Collector (GC) –
Here is how GC works and its advantages:
1.De-allocation or freeing of resources consumed by created instances.
üIn C#, the de-allocation or freeing of resources consumed by created instances occurs automatically on a system-determined schedule by an intelligent mechanism known as garbage collection.
üThe Garbage Collector (GC) is like a sweeper fish in an aquarium.
üIf you drop more food than the other fish can eat, the sweeper fish consumes the remaining food without leaving anything behind. 
üThe convenience and usefulness of GC has been known since Java.
2.Runs simultaneously with application
üThe GC in C# improves on the concept because it does not reduce the system's performance until really needed.
üIt is smarter than other garbage collectors currently on the market.
üYou can overcome the disadvantages of CG's nondeterministic behavior by using destructors and finalizers.
üYou can allocate member instances with constructors . Let's explore some important aspects of garbage collecting in .NET. 
3.Do not need to code destructors or finalizers
üIn C#, most of the time, you do not need to code destructors or finalizers because you can trust GC to clean up for you with destructors.
üThese functions are called implicitly by the C# runtime system's garbage collector. 

4.If explicit deterministic deallocation of objects is important in class and inheritance hierarchy.

Related Posts:

  • Common Language Runtime Common Language Runtime: Lets see what actually CLR is and why it is so important – 1.The Common Language Runtime (CLR) is the … Read More
  • .NET Framework Define .NET Framework: ›The .NET Framework is a new computing platform that simplifies application development in the highly distributed environmen… Read More
  • Base Class Library What is Base Class Library -   Base class library is a Common Language Infrastructure (CLI) standard library available to all the languages s… Read More
  • Benefits of Common Language Runtime Benefits of Common Language Runtime  These are the benefits of the CLR: üIt improves the performance if the applications. üIt has abilit… Read More
  • Garbage Collector (GC) Garbage Collector (GC) – Here is how GC works and its advantages: 1.De-allocation or freeing of resources consumed by created instances. üIn … Read More

0 comments:

Post a Comment