Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

About Garbage Collector?

Answer Posted / sayeed

Garbage collection is an in deterministic process Associated
with CLR. It is used to release the managed free Objects
that are no more refrenced.
But there might be scenarios in which we need to release
certain resources held by an object (like a database
connection) once the object is no longer in use.

We have destructors in C#.C# destructors are nothing but
finalize methods in disguise, with a call to base class's
finalize method.

As we know, finalize method is called during garbage
collection by garbage collector. Hence, we cannot rely only
on C# destructors to explicitly release resources as
finalize methods on objects may never be called altogether
(if the program terminates abnormally) or might be called
only when the program terminates (in a normal way).

Hence it is always a good practice to implement IDisposable
interface in such cases and to write code to release
resources explicitly in the Dispose() method.In that case we
have to use GC.SuppressFinalize() method.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between client-side and server-side validations in webpages?

1000


What is round trip in asp.net?

920


What is aspect-oriented programming?

1080


Which property is used to identify the Page is Post Back in ASP.NET?

1007


i want to implement grid view value in paypal site. so how to create this code in asp.net with C#

1850


How does the service stream content?

1017


What are the new login controls in asp.net 2.0?

973


What is view state and how it works in asp net?

981


What are the merits and demerits of viewstate?

1022


what are the web form events available in asp.net?

1026


What is asp.net globalization?

956


What is the difference between session object and application object?

1035


What are the types of session in asp.net?

957


How do we implement bundling in MVC?

1077


What is the significance of proxy user?

1064