Monday, August 2, 2010

DIFFRENCE BETWEEN GARBAGE COLLECTION AND DISPOSE METHOD.

(*) Garbage Collection is the .NET Framework way of freeing and releasing the memory occupied by managed objects of the .Net Object Oriented Programming model. The Garbage Collection is called by runtime to free memory used by "managed" resources.

(*) IDisposable.Dispose() method is also meant for same action of freeing resources. But in additon, you can make its best use to free "unmanaged" resources.

Now, what are the unmanaged resources. Unmanaged resources are such as Files, NetWork, Streams and COM types. So in this case these resources unnecessarily unknowingly consume much resources & GC also not helps.

No comments:

Post a Comment