<s>
The	O
buddy	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
technique	I-General_Concept
is	O
a	O
memory	B-General_Concept
allocation	I-General_Concept
algorithm	O
that	O
divides	O
memory	O
into	O
partitions	O
to	O
try	O
to	O
satisfy	O
a	O
memory	O
request	O
as	O
suitably	O
as	O
possible	O
.	O
</s>
<s>
The	O
Buddy	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
is	O
relatively	O
easy	O
to	O
implement	O
.	O
</s>
<s>
It	O
supports	O
limited	O
but	O
efficient	O
splitting	O
and	O
coalescing	B-General_Concept
of	I-General_Concept
memory	I-General_Concept
blocks	I-General_Concept
.	O
</s>
<s>
In	O
comparison	O
to	O
other	O
simpler	O
techniques	O
such	O
as	O
dynamic	B-Application
allocation	I-Application
,	O
the	O
buddy	B-General_Concept
memory	I-General_Concept
system	I-General_Concept
has	O
little	O
external	O
fragmentation	O
,	O
and	O
allows	O
for	O
compaction	B-General_Concept
of	O
memory	O
with	O
little	O
overhead	O
.	O
</s>
<s>
The	O
buddy	O
method	O
of	O
freeing	B-General_Concept
memory	I-General_Concept
is	O
fast	O
,	O
with	O
the	O
maximal	O
number	O
of	O
compactions	O
required	O
equal	O
to	O
log2(highest order )	O
.	O
</s>
<s>
Typically	O
the	O
buddy	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
system	O
is	O
implemented	O
with	O
the	O
use	O
of	O
a	O
binary	O
tree	O
to	O
represent	O
used	O
or	O
unused	O
split	O
memory	O
blocks	O
.	O
</s>
<s>
Because	O
of	O
the	O
way	O
the	O
buddy	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
technique	I-General_Concept
works	O
,	O
a	O
program	O
that	O
requests	O
66	O
K	O
of	O
memory	O
would	O
be	O
allocated	O
128	O
K	O
,	O
which	O
results	O
in	O
a	O
waste	O
of	O
62	O
K	O
of	O
memory	O
.	O
</s>
<s>
This	O
problem	O
can	O
be	O
solved	O
by	O
slab	B-General_Concept
allocation	I-General_Concept
,	O
which	O
may	O
be	O
layered	O
on	O
top	O
of	O
the	O
more	O
coarse	O
buddy	B-General_Concept
allocator	I-General_Concept
to	O
provide	O
more	O
fine-grained	O
allocation	O
.	O
</s>
<s>
One	O
version	O
of	O
the	O
buddy	B-General_Concept
allocation	I-General_Concept
algorithm	O
was	O
described	O
in	O
detail	O
by	O
Donald	O
Knuth	O
in	O
volume	O
1	O
of	O
The	B-General_Concept
Art	I-General_Concept
of	I-General_Concept
Computer	I-General_Concept
Programming	I-General_Concept
.	O
</s>
<s>
The	O
Linux	B-Operating_System
kernel	I-Operating_System
also	O
uses	O
the	O
buddy	O
system	O
,	O
with	O
further	O
modifications	O
to	O
minimise	O
external	O
fragmentation	O
,	O
along	O
with	O
various	O
other	O
allocators	O
to	O
manage	O
the	O
memory	O
within	O
blocks	O
.	O
</s>
<s>
jemalloc	O
is	O
a	O
modern	O
memory	B-General_Concept
allocator	I-General_Concept
that	O
employs	O
,	O
among	O
others	O
,	O
the	O
buddy	O
technique	O
.	O
</s>
