First off, there's no set timer that goes off to initialize the garbage collector.
Garbage collection happens when the user's system starts running low on resources or during periods of inactivity. You should, from a programmer's stand-point, consider it to go off randomly.
You can [u]request</u> the garbage collector to run, but almost everyone I know, and every author I've ever read, suggest against doing this manually.
If you need a resource released, or and action to occur upon garbage collection, it's best to have your class implement IDisposable and then use a using block for the variable.
|