How we free the memory in C#.NET.

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is c# easier than javascript?

677


What is c# entity framework?

642


What is the difference between abstract and abstraction?

627


what are the differences between a class and structure

733


How to properly clean up excel interop objects?

673






Name some properties of array.

697


What are the features of c#?

670


What is thread life cycle in c#?

662


Can we call server-side code (c# or vb.net code) from javascript?

691


Explain about Serialize and MarshalByRef?

695


What is the difference between finalize() and dispose() methods?

730


What is the difference between readkey and readline in c#?

636


What is a statement c#?

671


What is delegates and events?

643


Could you explain the difference between func vs action vs predicate?

615