Basic functionality of Garbage Collector

Question posted in Computer Software on 10 2010
Rate question difficulty level 0 Votes
What is the basic functionality of Garbage Collector in .Net
 
 
2 Answers
 
In an object-oriented environment every object than been created by the following steps:

1. Allocate memory for the type that represents the resource.
2. Initialize the memory to set the initial state of the resource and to make the resource usable.
3. Use the resource by accessing the instance members of the type (repeat as necessary).
4. Tear down the state of the resource to clean up.
5. Free the memory.

In the common language runtime (CLR), the garbage collector serves as an automatic memory manager. It provides the following benefits:

1.Enables you to develop your application without having to free memory.

2.Allocates objects on the managed heap efficiently.

3.Reclaims objects that are no longer being used, clears their memory, and keeps the memory available for future allocations. Managed objects automatically get clean content to start with, so their constructors do not have to initialize every data field.

4.Provides memory safety by making sure that an object cannot use the content of another object.


you can read more at http://msdn.microsoft.com/en-us/library/ee787088.aspx

10/12/2010
 
 
SEs

the managed heap efficiently. finance

03/25/2012
 
 
Add an answer*
 
Your name
Email
 
Company: Oblicore
Location: Israel
CLR .net developer

add a question

arrow_blue


Now hiring!
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------
---------------------------