Hi,
Each object or reference that is no longer used is marked for collection,
but the memory is not freed up straight away, garbage collection starts
automatically when the memory is running low or when triggered
programatically.
Once collection is started the GC goes through the heap in a linear fashion
and "de-allocates" objects that are not marked as being used, certain
objects need to have their Finalize() method called before they can be
destroyed.
a generation is the time between collections, generation 0 is the youngest
and since the heap is a stack, G-0 will be shortest lived (unless of course
an object is being used when a collection is started, in this case, it moves
up a generation. The frequency of the collections varies, however in general
G-0 is PARTIALY collected every second, G-1 every 10 partial collections of
G-0 and a complete collection is triggered after about 10 partial
collections of G-1
Mike Powell
www.ramuseco.com
"Surain Shen" <looong.shin (AT) gmail (DOT) com> wrote
Quote:
It's known, that .net app alloctes a block of memory and managed itselsf
(or by GC), and when gc do collect, it may not free the committed memory
immediately.
Who'd like tell me when will it REALLY free the memory. Any reply is
highly
appreciated! |