order of execution of mark and compact algorithms
-
Hi, I have a doubt regarding order of exectuion of mark and compact algorithms in Garbage collection process, which one will invoke first mark or compact, does compact algorithm execute firstly whenever all the roots were collected?
Thanks Mukkanti
-
Hi, I have a doubt regarding order of exectuion of mark and compact algorithms in Garbage collection process, which one will invoke first mark or compact, does compact algorithm execute firstly whenever all the roots were collected?
Thanks Mukkanti
Hi, a standard GC algorithm is first looking for live objects ("mark"), then either: - delete the unmarked objects; - or compact the marked ones, ignoring the unmarked objects. In .NET compaction is used (except for the "Huge Object Heap"). :)
Luc Pattyn [Forum Guidelines] [My Articles]
Fixturized forever. :confused: