This article says
If an object has a finalizer, it is not immediately deleted if the garbage collector decides that it no longer "lives". Instead, it becomes a special root type until .NET calls the finalizer method. This means that for these objects usually requires more than one garbage collection will be deleted from memory, as they will survive the time when they are considered unused.
My question is, why does the GC not call the finalizer when it detects that the object can no longer reference and assemble the object right away? why is it needed more than garbage collection?
Two points are considered:
. , - . , , ( ). , GC , .
, - , ( ), ... , ?
( GC), GC . , , . :
, , , , GC ( ).
IDisposable Dispose() ; , .
IDisposable
Dispose()
.net, : , "" , , any, "" , , , , , . ; , "". , , Finalize() . , , "" GC.