During two-pass sliding compaction, a heap may first be logically divided
into fixed-sized segments, or chunks, and information regarding each
chunk, known as per-chunk metadata, may be saved for use during the
second, sliding phase. In addition to the per-chunk information,
information regarding the location and size, called object extent
information, may also be saved during the marking phase of two-pass
sliding compaction. In the sliding phase of two-pass sliding compaction,
live objects are moved to their respective destinations in the heap after
first updating any object references in the objects. The order of objects
being moved may be maintained across heap compaction. By relying upon the
per-chunk and object extent information saved during the marking phase,
objects may be processed individually and independent of each other
during the sliding phase, according to some embodiments.