Hello Adam
let me try to shine some light on the subject
In java when you want to invoke the GC you need to do this
Runtime objFoo = Runtime.getRuntime();
objFoo.gc();
in .Net however the GC is in the system namespace
so the equivalant for above java code would be GC.Collect()
However as Cor mentioned calling the GC.Collect method to cause an induced
garbage collection is usually a bad idea
The only valid situation i can think of is when the application is idle and
if you see that unexpected garbage collections are slowing down the
application during time critical operations ( example : your program is in
charge of controling hardware devices that require a short response time )
In all other situations i would say , let the GC doe it`s work as how it was
intended to do so , as this gives you the highest performance
Regards
And happy coding
Michel Posseth [MCP]