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 application session?

1037


Will the asp.net validators run in server side or client side? How do you do client-side validation in .net? How to disable validator control by client side javascript?

1113


What are session and cookies?

1024


Define cookie.

1032


Difference between application events and session events

1072


Explain the differences between managed and unmanaged code?

1104


How to use a Master Database in Asp.net?

1113


What are the advantages and disadvantages of session?

1169


Are xaml file compiled or built on runtime?

1017


What are the Types of objects in ASP

1143


How response object is related to asp's response object?

959


What are ASHX files?

1151


Can you explain composite pattern?

1092


Explain the difference between inline and code behind - which is best in?

1056


Explain what benefit does your code receive if you decorate it with attributes demanding specific security permissions?

1076