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 do you prevent a class from being inherited in c#?

0 Answers  


Which of the following API is used to hide a window?

0 Answers   3i Infotech,


About delegates and events?

2 Answers   ADITI,


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

5 Answers  


How many aware interfaces are there?

0 Answers  






What are synchronous and asynchronous operations?

0 Answers  


What to implement on my class Finalize or IDisposable

0 Answers   HCL,


In .NET which is the smallest unit of execution?

0 Answers   Siebel,


What is iformatprovider in c#?

0 Answers  


What is static and use of it?

0 Answers  


What are primitive data types in c#?

0 Answers  


can we declare a variable by name "this" in a class? Please explain?

3 Answers   IBM,


Categories