C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







Garbage Collcetion


Posted Date: 02 Jun 2008    Resource Type: Articles    Category: .NET Framework

Posted By: Debasmit Samal       Member Level: Gold
Rating:     Points: 10



Garbage Collcetion is responsible for allocating & deallocating memeory needed to store Objects and Value types.
Garbage Collcetor is part of CLR Memory Management System .

Garbage collection is automated in C#

Garbage Collector stores data based upon the Types.VALUE types are stored in STACK and Object are stored in HEAP.

When the Garbage Collector performs the operation of collection ,it checks for the object in the HEAP ,which haven't been accessed or used from some instance pf time and hence it removes such objects and allocates that memory (re-collected) to the newly created /generated objects .The location of the un used objects is known with the help of METADATA concept.The same process happnes same with the VALUE types too.


Rule: If the managed heap does not have sufficient memory to allocate a requested object, a garbage collection will occur.


Garbage collection steps
1. The garbage collector searches for managed objects that are referenced in managed code
2. The garbage collector attempts to finalize objects that are unreachable
3. The garbage collector frees objects that are unmarked and reclaims their memory

Automatic memory management
• reduces programmer burden
• eliminates sources of errors
• integral to modern object-oriented languages, i.e., Java, C#
• now part of mainstream computing
• Challenge:– performance efficiency




Responses

Author: Arun Kumar    05 Jun 2008Member Level: Bronze   Points : 1
Please specify the generation in garbage collection to make it a good article


Author: Mahesh Raj    07 Jun 2008Member Level: Gold   Points : 1
This is very good information,Continue posting such useful articles.


Feedbacks      
Popular Tags   What are tags ?   Search 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: Automating Word to accommodate Spell Check Functionality in your .Net windows application
Previous Resource: Resize Image With Aspect Ratio ?
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

web conferencing services

Contact Us    Privacy Policy    Terms Of Use