What you want to do is call GC.SuppressFinalize() if you handle the cleanup yourself ... Usually you use GC.SuppressFinalize() within an IDisposable . See this sample code for general use of IDisposable :
http://msdn.microsoft.com/en-us/library/system.gc.suppressfinalize.aspx
If you really need to collect garbage right away,
var myObj = new MyObject();
But I warn you that you really must let the object go out of scope and let the GC collect objects in a natural way. .NET runtime is very effective at managing memory until you try to do this work.
EDIT
After looking at the comments, I see that you forgot to leave important information, since you linked this object to other methods of objects. This means that the object you are trying to complete will not complete until the method used to monitor the event completes, thereby storing about a thousand additional objects in memory.
What you can do to break this strong link is to use an object called WeakReference . Or use lambda to break strong links.
See this for an example of using WeakReference http://msdn.microsoft.com/en-us/library/system.weakreference.aspx
Or you can do something like this:
dym.cas += (x, y, z) => gameTime.ElapsedGameTime(x,y,z);
instead
dym.cas += gameTime.ElapsedGameTime;
source share