Your scars of survival are your armor for life

More than anything else we will fight to survive. This is a fantastic instinct to have. It means that you are already wired to fight, to strive, to kick-ass when the shit hits the fan! Right now…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




What is Garbage Collection ? How it Works ?

Garbage collection is know as automation storage reclamation (i.e) it is the process of releasing the memory used by the objects, which are no longer referenced. This is done in different ways and different manners in various platforms and languages.

So when a program starts, the system allocates the memory for that to execute. There are two different place where the CLR stores the objects STACK and HEAP.

Inside the GC, the memory is separated into three parts,

So What happens when a new object is created ?

These all will always happen in the Generation 0.

So What happens if the object doesn’t fit into the Generation 0, then the GC comes into picture.

Now the Generation 0 is fully available for allocating the objects. The same happens for the Generation 1 while moving the objects from the Generation 0 if the Generation 1 is full, the Generation 1 items will be moved to Generation 2.

What happens when all the Generations are full ? Yes, It throws the MemoryOutofRangeException.

GC will be invoked automatically, If you need to invoke the collect method manually call GC.Collect(). Please do refer the below links for further more details.

Add a comment

Related posts:

Exotic Shoes for Spring

When spring comes the weather warms, plants bloom, homeowner’s clean out garages, and shoe lovers bask in the new footwear collections reflecting the new season’s hottest stylings and colors. For…

Read Online Who Was Albert Einstein? Full access by Jess M. Brallier

If you want to get Who Was Albert Einstein? please visit this link : http://unlimitedebookdownload.blogspot.com/?book=0448424967 ************************************************************* -Meet…