About Garbage Collector?

Answers were Sorted based on User's Feedback



About Garbage Collector?..

Answer / 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

About Garbage Collector?..

Answer / seshu

garbage collection is a form of automatic memory management.
The garbage collector attempts to reclaim garbage or memory
used by objects that will never be accessed or mutated again
by the application.

Is This Answer Correct ?    0 Yes 0 No

About Garbage Collector?..

Answer / sivaprasad

i)GarbageCollector will take care about Automatic Memory
Management it will mark the objects which has Referrence
Count is Zero.
ii)One Background Thread running in the Application with
Normal Priority And Marking The Objects Which has Referrence
Count is Zero.when there is no Applications Threads Are
Running it will Take High Priority.
iii)And this Garbage Collector Will Take Care About
"Circularreferrences"(means One Pair Of Objects Referring To
Each Other)

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More ASP.NET Interview Questions

You are using the try? catch block seen in the following code segment, but no exceptions are ever caught by the catch block. What is the problem? SqlConnection cn =new sqlConnection(strSQL); SqlDataSet ds; try { cn.open(); //perform the data processing steps ??.. } catch (OleDbException e) { ?.. } a) The exception class is wrong; it should be sqlErrors. b) The exception class is wrong; it should be sqlSyntaxExceptios. c) The exception class is wrong; it should be sqlExceptions. d) The exception class is wrong; it should be sqlExcptions.

2 Answers   Microsoft, Syntax Softtech,


Finally and dispose methods?

1 Answers   Microsoft,


When a dropdownlist has been added by some records and it has been binded why it is not executing i'm facing this error pls help me ? if (is!pageposback) { arraylist books = new arraylist; books.add ("gone with the wind"); books.add ("rahulsriramprakash"); books.add ("vishal"); dropdowndisplay.datasource=books; dropdowndisplay.databind(); } The error is : 1) The dropdowndisplay does not exist.

5 Answers   Netsweeper,


What is recordset asp?

0 Answers  


Explain Authentication mechanism in dotnet

0 Answers   BirlaSoft,






Where is ViewState information stored?

18 Answers   DSRC, HCL,


What is ISAPI?

2 Answers   IBM,


Difference between web.config and app.config?

3 Answers   ITC Infotech, Jenesys Technologies,


Is object a value type or referenced type?

2 Answers  


How many types are there session

5 Answers   TCS,


How to use class library reference in asp.net project? Can you give me the example with source Class library haves classes like Database, insert, update, delete, reflection how can i use the database class connection in insert class to insert the record in to the Main Project in asp.net.

1 Answers  


In which event of the page life cycle, is the viewstate available?

0 Answers  


Categories