How we free the memory in C#.NET.

Answers were Sorted based on User's Feedback



How we free the memory in C#.NET...

Answer / prashanth s

Actually the freeing of the memory is done by the CLR
automatically by calling the garbage collection routine.
But the declared objects by the user can be deallocated
manually by using dispose function in the class by
implementing IDisposable interface in the object class.
Otherwise it can also be done by implementing a destructor
in the class, as the destructor defined will help
deallocating the object allocation after the usage of the
object gets over, i.e the object is not used anywhere else
in the program.

Is This Answer Correct ?    15 Yes 0 No

How we free the memory in C#.NET...

Answer / geetanjali

by desructor or globilization

Is This Answer Correct ?    7 Yes 5 No

How we free the memory in C#.NET...

Answer / mayur teli

We can also use Using statement
when we use it, there is no need to explicitly dispose the object. Using statement take care of it.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More C Sharp Interview Questions

Why can?t you specify the accessibility modifier for methods inside the interface?

3 Answers   Mind Tree, Siebel Systems,


Why is c# used?

0 Answers  


Is lazy thread safe c#?

0 Answers  


Hi Friends, I am going through Siemens Interview Procedure from last 1+1/2 months. I went through 1 written + 2 Technical + 1 Managerial Round process after which I got call from HR informing that "you are selected and we would like to meet you for HR round". HR round was very nominal compared to MR. HR Round last for hardly 5 mins. They told me that you will get the final result on Friday. Still I have not received any feedback from them. Please help!!!

0 Answers   Siemens,


Difference between a sub and a function in c#.

0 Answers  






What is the solution if you need to manipulate sets of items?

0 Answers  


Why do we use classes?

0 Answers  


How do I automate my desktop application?

0 Answers  


Name the method of servicebase class?

0 Answers  


What is static classes?

0 Answers  


Distinguish between system.string and system.text.stringbuilder classes?

0 Answers  


Which are the loop types available in c#?

0 Answers  


Categories