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 difference between cookies and cache?

1001


What is the base class from which web forms are inherited?

948


What is difference Between Authentication and authorization?

1065


How many types of state management are there in asp net?

981


What is the request flow used for asp.net mvc framework? : asp.net mvc

927


How ViewstateMac works?

2776


What do you mean by query string?

895


Tell me the code snippet to show how we can return 404 errors from HttpError?

1218


How to automatically get the latest version of all the asp.net solution items from source safe when opening the solution?

914


What is .net remoting?

993


How to set the pane area to transparent of a scrollPane component.?

960


Is razor a programming language?

937


Explain the role of global.asax?

933


What is globalization and localization in asp net?

916


Which protocol is used to call a web service?

997