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

How to create multi-dimensional array?

0 Answers   C DAC, CDAC,


What is yield c#?

0 Answers  


What is datasource c#?

0 Answers  


Can you mark static constructor with access modifiers?

0 Answers  


What is strong name in c# and how can we use it?

0 Answers   DELL,






How to find methods of a assembly file (not using ILDASM)?

0 Answers  


Explain the difference between abstract class and interface.

0 Answers   Accenture,


Can dictionary have duplicate keys c#?

0 Answers  


What is the xml document structure?

0 Answers  


How to raise an selection changed event associated with listbox in datagridview control with a sample example?Here the listbox is a child control associated with datagridview control.

3 Answers  


How?s method overriding different from overloading?

2 Answers   Visual Soft,


Is it possible to add two 50 digit numbers in .net? If yes what is the code snippet?

2 Answers   Cognizant, W3 Solutions, Zefer,


Categories