.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Sandeep Singh
Melody Anderson
Eminent IT

Home >> Code Snippets >> Visual Studio >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Garbage collection in Framework

Posted By:Karthikeyan Anbarasan       Posted Date: May 27, 2011    Points: 40    Category: Visual Studio    URL: http://www.dotnetspark.com  

This small article cover important topic of Garbage collection in Framework

Garbage collection is a 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.

When an program is loaded in the memory there will be a bunch of memory allocated for that particular program alone and loaded with memory. This bunch of memory is called Managed Heap(is nothing but a bunch of memory allocated for the program at run time). This amount of memory will only be used when an object is to be loaded in to the memory for that particular program.
This memory is separated in to three parts:

·         Generation Zero - Smaller size

·         Generation One - Medium size

·         Generation Two - Larger size

When we try to create an object by using NEW keyword the system will,

·         Calculate the number of bytes required for the object or type to be loaded in to the managed heap.

·         The CLR then checks that the bytes required to allocate the object are available in the reserved region. IF the object fits, it is allocated at the address pointed to by NextObjPtr.

·         These processes will happen at the Generation zero level.


Further Readings:


No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend