In class- We calculated 2^30 * (1nsec + 1nsec) = 2.14 sec
How often would compaction have to be completed? Why? (2)
ANSWER :
* The algorithmic difficulty in a compaction algorithm is about updating all pointers, so that they point to the new object location.
* Through strict typing, the .NET virtual machine can unambiguously decide whether each word in RAM is a pointer or not, but updating all pointers efficiently without using too much extra RAM can be tricky.
* Additional complexity comes from generational collectors which try, most of the time, to leave most of the objects untouched, working preferentially with young objects only.
* Here, this means compacting only the end of the heap; full compaction being applied only rarely.
* The point here is that a full compaction, although linear, could still induce a noticeable pause.
Generational GC tries to make such pauses rarer.
Get Answers For Free
Most questions answered within 1 hours.