Anyone have a good method for causing the window's garbage collector to run?
Printable View
Anyone have a good method for causing the window's garbage collector to run?
I'm not sure there is such a thing. You can force a garbage collector run for your application by using System.GC.Collect().
Cheers,
NTG
lol isn't your solution doing what you said you weren't sure existedQuote:
Originally Posted by ntg
:bigyello:
Existential!
did I post this in the .Net forum or did it get moved?
Anyway, guess maybe I shoulda specified that I was working in vb6. :(
:D I don't think there is a garbage collector for a window alone. ;)Quote:
Originally Posted by kleinma
i took it as the window's garbage collector as inQuote:
Originally Posted by ntg
the Microsoft Windows garbage collector... (as in the CRL garbage collector)
:bigyello:
you need to call GC.WaitForPendingFinilizers() right after thatQuote:
Originally Posted by ntg
Why is that ?Quote:
Originally Posted by MrPolite
pauses your threadQuote:
Originally Posted by ntg
http://msdn.microsoft.com/library/de...izersTopic.asp
umm to be honest I've been using it blindly. Back yay when I was learning about vb.net for the first time, I read in a book or wherever that you should always call that after gc.collect().... that isnt completely true I guess:D
Yeah, I thought that you should call that only if you need to wait for GC to finish. That would be the case if you need finalizers to finish their work and therefore release all resources.