In an object-oriented environment, every type identifies some resource available for your program's use. To use any of these resources requires that memory be allocated to represent the type. The steps required to access a resource are as follows:
- Allocate memory for the type that represents the resource.
- Initialize the memory to set the initial state of the resource and to make the resource usable.
- Use the resource by accessing the instance members of the type (repeat as necessary).
- Tear down the state of the resource to clean up.
- Free the memory.
How does the managed heap know when an object is no longer in use by the application?
Click Here.
Fundamentals of Garbage Collections. Click Here.
Performance.Click Here