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

What is the function of .IsDescendent()?

0 Answers   Abacus,


What is string method in c#?

0 Answers  


Is c# used for frontend or backend?

0 Answers  


What does a constructor do c#?

0 Answers  


What is the CTS, and how does it relate to the CLS?

0 Answers   Arigo Infotech,






Explain acid rule of thumb for transactions in c#.

0 Answers  


Is void a class?

0 Answers  


What operator means?

0 Answers  


What is the use of tuple in c#?

0 Answers  


Why do we need reflection in c#?

0 Answers  


Give an example of a directcast.

0 Answers  


If a class derives from another class, will the derived class automatically contain all the public, protected, and internal members of the base class?

0 Answers  


Categories