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...






Forums » .NET » .NET »

GC


Posted Date: 04 Dec 2008      Posted By: kiran      Member Level: Silver     Points: 1   Responses: 3



How the GC works? and At what time interval GC will be called?




Responses

Author: vijay anand    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

Garbage Collection :- CLR automatically manages memory thus eliminating
memory leaks. When objects are not referred GC automatically releases those memories thus providing efficient memory management.



Author: vijay anand    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 4

Garbage collection is a CLR feature which automatically manages memory. Programmers forget
to release the objects while coding ..... Laziness (Remember in VB6 where one of the good
practices is to set object to nothing). CLR automatically releases objects when they are no longer in
use and refernced. CLR runs on non-deterministic to see the unused objects and cleans them. One
side effect of this non-deterministic feature is that we cannot assume an object is destroyed when
it goes out of the scope of a function. Therefore, we should not put code into a class destructor
to release resources.

System.GC.Collect() forces garbage collector to run



Author: Sridhar    04 Dec 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 2

HI,
The intention of the Garbage Collector is to release the memory of the objects which are not being used.
This will be called automatically when there is no sufficent memory.
And the second case is it will be called automatically on the random basis.



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Bulk Mail Server using C#
Previous : GmDateTimePicker
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use