Search This Blog

Nov 1, 2011

In .Net programmer is not responsible to clean the memory from managed type. It is happened automatically by Garbage collector. However sometime it becomes programmer responsibility to clean memory from unmanaged resources.

In CSharp you can achieve this either via finalize method or Dispose method. Dispose method is always suggested. It is good to use when you want to cleanup your resources. It is implemented from I Disposable interface. It is always advisable do not call Dispose because it dose nothing.