I don't think that you need to do any disposable objects manager. GC already manage memory for you. As you probably already know, Dispose method is the one coming from the IDisposable interface include in .Net framework. But it's a method like any one else*. The garbage collector don't wait that Dispose to be called to free the memory of an object. He monitor if the object is always reachable from somewhere or not. This help him to determine which object are alive and which are dead.
Before to continue read a bit about GC generation. http://msdn.microsoft.com/en-us/library/ms973837.aspx
I'm not sure, but when new() is call, and GC reach the capacity of the actual used generation, he clear the next generation "dead" objects. Probably at other times that i don't. GC is such a mystic and mysterious implementation, because is probably rote in C++. But you don't have to care about it.
In some cases (mono-develop), I heard that you should care more about it. But not if you code in a Microsoft environment.
*I told:
method like any one else
but the using block give you the freedom to don't care to call Dispose method of IDisposable objects and call the method for you. The existing being of method Dispose is to release resources that needs to be released before stop using an object.
ex:
public class Test : IDisposable
{
public void Dispose()
{
// release other necessary ressources if needed
Console.WriteLine("Disposed");
}
}
{
using (IDisposable disposable = new Test())
{
}
}
same as:
{
IDisposable disposable = new Test()
disposable.Dispose();
}
So you can be confident about GC. If you want to be sure that GC will free you object memory, just make all references to it at null. And GC will consider your object as "dead" :P