C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

Automatic memory management


Posted Date: 16 Oct 2006    Resource Type: Articles    Category: .NET Framework
Author: Sukanya Member Level: Diamond    
Rating: 1 out of 5Points: 8



Dotnet framework has a special feature as automatic memory management .It is down with the help of garbage collector in CLR.mainly this process involves the following


1.Allocating memory:
2.Releasing memory:
3.Implementing finalizes:


Allocating memory:

Automatically allocate objects in the heap at runtime .The memory heap keeps the pointer where the next object is to be placed .when the new object is created it will allocate memory in the heap orderly .so the pointer incremented after the object is created. It will allocate memory with in the less time.

Releasing memory:


When the there is a insufficient memory we have to release the unused objects in the memory. This is taken care by garbage collector. Garbage collector is having all the unused objects.It will divide all the unused objects into three generations 0,1,and 2 and placed into heap.0 generation will contain most recently created objects, and 1, 2 are latter created objects.So when there is in sufficient memory in the 0 generated objects then automatically the least generated objects like 1,2 will be deleted. So when there is insufficient memory in the objects automatically it will be deleted and allocate memory for that.

Implementing finalizer:

To de-allocate objects in the memory Garbage collector call the dispose method to dispose the unused objects that are there in the memory.





Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Introduction to encapsulation in C# with accesssors
Previous Resource: .NET FAQS
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use