[Mono-dev] Garbage collection for threads

Miguel de Icaza miguel at novell.com
Fri Jan 11 19:00:19 EST 2008

> 1)	If an application is blocked on a IO read, will the GC thread still run and 
> collect freed objects ? I thought the GC thread always runs, no matter what, 
> but it does not look like it. What is the intended behaviour ? I hope the 
> answer works for threads too i.e. if some thread is blocked, will the GC 
> clean away objects freed previously in that thread ?

Yes, it will.

> 2) After a thread is finished and there are no references of it anywhere, what 
> is an approximate time after which the thread (and the objects created in the 
> Thread.Start method) will be freed ? 1sec/1min/10 min - really I am asking if 
> there is any way the thread could still linger in the memory for a long time 
> (long ~ 10mins or more).

The thread object might go away, but the OS thread will continue to
exist.   The OS thread needs to terminate for it to be finished.


More information about the Mono-devel-list mailing list