<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
mark	B-General_Concept
–	I-General_Concept
compact	I-General_Concept
algorithm	I-General_Concept
is	O
a	O
type	O
of	O
garbage	B-General_Concept
collection	I-General_Concept
algorithm	O
used	O
to	O
reclaim	O
unreachable	B-General_Concept
memory	I-General_Concept
.	O
</s>
<s>
Mark	B-General_Concept
–	I-General_Concept
compact	I-General_Concept
algorithms	I-General_Concept
can	O
be	O
regarded	O
as	O
a	O
combination	O
of	O
the	O
mark	O
–	O
sweep	O
algorithm	O
and	O
Cheney	B-General_Concept
's	I-General_Concept
copying	I-General_Concept
algorithm	I-General_Concept
.	O
</s>
<s>
Compacting	O
garbage	B-General_Concept
collection	I-General_Concept
is	O
used	O
by	O
modern	O
JVMs	B-Language
,	O
Microsoft	O
's	O
Common	O
Language	O
Runtime	O
and	O
by	O
the	B-Application
Glasgow	I-Application
Haskell	I-Application
Compiler	I-Application
.	O
</s>
<s>
After	O
marking	O
the	O
live	O
objects	O
in	O
the	O
heap	O
in	O
the	O
same	O
fashion	O
as	O
the	O
mark	O
–	O
sweep	O
algorithm	O
,	O
the	O
heap	O
will	O
often	O
be	O
fragmented	B-Architecture
.	O
</s>
<s>
The	O
goal	O
of	O
mark	B-General_Concept
–	I-General_Concept
compact	I-General_Concept
algorithms	I-General_Concept
is	O
to	O
shift	O
the	O
live	O
objects	O
in	O
memory	O
together	O
so	O
the	O
fragmentation	B-Architecture
is	O
eliminated	O
.	O
</s>
<s>
These	O
movements	O
of	O
the	O
break	O
table	O
,	O
(	O
called	O
rolling	O
the	O
table	O
by	O
the	O
authors	O
)	O
cause	O
the	O
relocation	O
records	O
to	O
become	O
disordered	O
,	O
requiring	O
the	O
break	O
table	O
to	O
be	O
sorted	B-Algorithm
after	O
the	O
compaction	O
is	O
complete	O
.	O
</s>
<s>
The	O
live	O
objects	O
are	O
examined	O
for	O
pointers	O
,	O
which	O
can	O
be	O
looked	O
up	O
in	O
the	O
sorted	B-Algorithm
break	O
table	O
of	O
size	O
n	O
in	O
O(logn )	O
time	O
if	O
the	O
break	O
table	O
is	O
sorted	B-Algorithm
,	O
for	O
a	O
total	O
running	O
time	O
of	O
O(nlogn )	O
.	O
</s>
<s>
In	O
addition	O
,	O
heap	O
objects	O
must	O
have	O
a	O
separate	O
forwarding	O
pointer	O
slot	O
that	O
is	O
not	O
used	O
outside	O
of	O
garbage	B-General_Concept
collection	I-General_Concept
.	O
</s>
<s>
This	O
algorithm	O
is	O
O(n )	O
on	O
the	O
size	O
of	O
the	O
heap	O
;	O
it	O
has	O
a	O
better	O
complexity	O
than	O
the	O
table-based	O
approach	O
,	O
but	O
the	O
table-based	O
approach	O
's	O
n	O
is	O
the	O
size	O
of	O
the	O
used	O
space	O
only	O
,	O
not	O
the	O
entire	O
heap	O
space	O
as	O
in	O
the	O
LISP2	B-Language
algorithm	O
.	O
</s>
<s>
However	O
,	O
the	O
LISP2	B-Language
algorithm	O
is	O
simpler	O
to	O
implement	O
.	O
</s>
