() . , ThreadAbort OutOfMemory . .
CriticalFinalizerObject , , "" , . SafeHandle CriticalFinalizerObject . , , , , , , ThreadAbortException.
() IDisposable
using(), IDisposable - . using(), . .
, CriticalFinalizerObject , , , using() - . .
using() , , , Dispose() .
GC
Compaction of the heap can be more efficient because objects that remain for a long time in the end are packed together. In the NET Framework, only the lowest generation (most recently created objects) is compressed aggressively. Theres is a great optimization done under the hood. It is interesting to read, but not important for the job. If you want to know more about this, find articles on “generation garbage collection”.
source
share