<s>
In	O
computer	B-General_Concept
storage	I-General_Concept
,	O
fragmentation	B-Application
is	O
a	O
phenomenon	O
in	O
which	O
storage	O
space	O
,	O
main	O
storage	O
or	O
secondary	O
storage	O
,	O
is	O
used	O
inefficiently	O
,	O
reducing	O
capacity	O
or	O
performance	O
and	O
often	O
both	O
.	O
</s>
<s>
The	O
exact	O
consequences	O
of	O
fragmentation	B-Application
depend	O
on	O
the	O
specific	O
system	O
of	O
storage	O
allocation	O
in	O
use	O
and	O
the	O
particular	O
form	O
of	O
fragmentation	B-Application
.	O
</s>
<s>
In	O
many	O
cases	O
,	O
fragmentation	B-Application
leads	O
to	O
storage	O
space	O
being	O
"	O
wasted	O
"	O
,	O
and	O
in	O
that	O
case	O
the	O
term	O
also	O
refers	O
to	O
the	O
wasted	O
space	O
itself	O
.	O
</s>
<s>
In	O
main	O
memory	B-Architecture
fragmentation	I-Architecture
,	O
when	O
a	O
computer	O
program	O
requests	O
blocks	B-General_Concept
of	O
memory	O
from	O
the	O
computer	O
system	O
,	O
the	O
blocks	B-General_Concept
are	O
allocated	B-General_Concept
in	O
chunks	O
.	O
</s>
<s>
When	O
the	O
computer	O
program	O
is	O
finished	O
with	O
a	O
chunk	O
,	O
it	O
can	O
free	O
it	O
back	O
to	O
the	O
system	O
,	O
making	O
it	O
available	O
to	O
later	O
be	O
allocated	B-General_Concept
again	O
to	O
another	O
or	O
the	O
same	O
program	O
.	O
</s>
<s>
When	O
a	O
program	O
is	O
started	O
,	O
the	O
free	O
memory	O
areas	O
are	O
long	O
and	O
contiguous	B-Architecture
.	O
</s>
<s>
Over	O
time	O
and	O
with	O
use	O
,	O
the	O
long	O
contiguous	B-Architecture
regions	O
become	O
fragmented	O
into	O
smaller	O
and	O
smaller	O
contiguous	B-Architecture
areas	O
.	O
</s>
<s>
Eventually	O
,	O
it	O
may	O
become	O
impossible	O
for	O
the	O
program	O
to	O
obtain	O
large	O
contiguous	B-Architecture
chunks	O
of	O
memory	O
.	O
</s>
<s>
There	O
are	O
three	O
different	O
but	O
related	O
forms	O
of	O
fragmentation	B-Application
:	O
external	O
fragmentation	B-Application
,	O
internal	O
fragmentation	B-Application
,	O
and	O
data	B-Architecture
fragmentation	I-Architecture
,	O
which	O
can	O
be	O
present	O
in	O
isolation	O
or	O
conjunction	O
.	O
</s>
<s>
Fragmentation	B-Application
is	O
often	O
accepted	O
in	O
return	O
for	O
improvements	O
in	O
speed	O
or	O
simplicity	O
.	O
</s>
<s>
Analogous	O
phenomena	O
occur	O
for	O
other	O
resources	B-General_Concept
such	O
as	O
processors	O
;	O
see	O
below	O
.	O
</s>
<s>
Memory	B-Architecture
paging	I-Architecture
creates	O
internal	O
fragmentation	B-Application
because	O
an	O
entire	O
page	B-General_Concept
frame	I-General_Concept
will	O
be	O
allocated	B-General_Concept
whether	O
or	O
not	O
that	O
much	O
storage	O
is	O
needed	O
.	O
</s>
<s>
Due	O
to	O
the	O
rules	O
governing	O
memory	B-General_Concept
allocation	I-General_Concept
,	O
more	O
computer	O
memory	O
is	O
sometimes	O
allocated	B-General_Concept
than	O
is	O
needed	O
.	O
</s>
<s>
In	O
this	O
scenario	O
,	O
the	O
unusable	O
memory	O
is	O
contained	O
within	O
an	O
allocated	B-General_Concept
region	O
.	O
</s>
<s>
This	O
waste	O
is	O
called	O
internal	O
fragmentation	B-Application
.	O
</s>
<s>
Unlike	O
other	O
types	O
of	O
fragmentation	B-Application
,	O
internal	O
fragmentation	B-Application
is	O
difficult	O
to	O
reclaim	O
;	O
usually	O
the	O
best	O
way	O
to	O
remove	O
it	O
is	O
with	O
a	O
design	O
change	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
dynamic	B-General_Concept
memory	I-General_Concept
allocation	I-General_Concept
,	O
memory	B-General_Concept
pools	I-General_Concept
drastically	O
cut	O
internal	O
fragmentation	B-Application
by	O
spreading	O
the	O
space	O
overhead	O
over	O
a	O
larger	O
number	O
of	O
objects	O
.	O
</s>
<s>
External	O
fragmentation	B-Application
arises	O
when	O
free	O
memory	O
is	O
separated	O
into	O
small	O
blocks	B-General_Concept
and	O
is	O
interspersed	O
by	O
allocated	B-General_Concept
memory	O
.	O
</s>
<s>
It	O
is	O
a	O
weakness	O
of	O
certain	O
storage	O
allocation	B-General_Concept
algorithms	I-General_Concept
,	O
when	O
they	O
fail	O
to	O
order	O
memory	O
used	O
by	O
programs	O
efficiently	O
.	O
</s>
<s>
The	O
term	O
"	O
external	O
"	O
refers	O
to	O
the	O
fact	O
that	O
the	O
unusable	O
storage	O
is	O
outside	O
the	O
allocated	B-General_Concept
regions	O
.	O
</s>
<s>
For	O
example	O
,	O
consider	O
a	O
situation	O
wherein	O
a	O
program	O
allocates	O
three	O
continuous	O
blocks	B-General_Concept
of	O
memory	O
and	O
then	O
frees	O
the	O
middle	O
block	O
.	O
</s>
<s>
The	O
memory	B-General_Concept
allocator	I-General_Concept
can	O
use	O
this	O
free	O
block	O
of	O
memory	O
for	O
future	O
allocations	O
.	O
</s>
<s>
However	O
,	O
it	O
cannot	O
use	O
this	O
block	O
if	O
the	O
memory	O
to	O
be	O
allocated	B-General_Concept
is	O
larger	O
in	O
size	O
than	O
this	O
free	O
block	O
.	O
</s>
<s>
External	O
fragmentation	B-Application
also	O
occurs	O
in	O
file	B-Application
systems	I-Application
as	O
many	O
files	O
of	O
different	O
sizes	O
are	O
created	O
,	O
change	O
size	O
,	O
and	O
are	O
deleted	O
.	O
</s>
<s>
A	O
B	O
C	O
Allocated	B-General_Concept
three	O
blocks	B-General_Concept
A	O
,	O
B	O
,	O
and	O
C	O
,	O
of	O
size	O
0x1000	O
.	O
</s>
<s>
Data	B-Architecture
fragmentation	I-Architecture
occurs	O
when	O
a	O
collection	O
of	O
data	O
in	O
memory	O
is	O
broken	O
up	O
into	O
many	O
pieces	O
that	O
are	O
not	O
close	O
together	O
.	O
</s>
<s>
It	O
is	O
typically	O
the	O
result	O
of	O
attempting	O
to	O
insert	O
a	O
large	O
object	O
into	O
storage	O
that	O
has	O
already	O
suffered	O
external	O
fragmentation	B-Application
.	O
</s>
<s>
For	O
example	O
,	O
files	O
in	O
a	O
file	B-Application
system	I-Application
are	O
usually	O
managed	O
in	O
units	O
called	O
blocks	B-General_Concept
or	O
clusters	B-Application
.	O
</s>
<s>
When	O
a	O
file	B-Application
system	I-Application
is	O
created	O
,	O
there	O
is	O
free	O
space	O
to	O
store	O
file	O
blocks	B-General_Concept
together	O
contiguously	B-Application
.	O
</s>
<s>
This	O
allows	O
for	O
rapid	O
sequential	B-Application
file	I-Application
reads	O
and	O
writes	O
.	O
</s>
<s>
When	O
a	O
new	O
file	O
is	O
written	O
,	O
or	O
when	O
an	O
existing	O
file	O
is	O
extended	O
,	O
the	O
operating	O
system	O
puts	O
the	O
new	O
data	O
in	O
new	O
non-contiguous	O
data	O
blocks	B-General_Concept
to	O
fit	O
into	O
the	O
available	O
holes	O
.	O
</s>
<s>
The	O
new	O
data	O
blocks	B-General_Concept
are	O
necessarily	O
scattered	O
,	O
slowing	O
access	O
due	O
to	O
seek	O
time	O
and	O
rotational	O
latency	O
of	O
the	O
read/write	O
head	O
,	O
and	O
incurring	O
additional	O
overhead	O
to	O
manage	O
additional	O
locations	O
.	O
</s>
<s>
This	O
is	O
called	O
file	B-Application
system	I-Application
fragmentation	I-Application
.	O
</s>
<s>
When	O
writing	O
a	O
new	O
file	O
of	O
a	O
known	O
size	O
,	O
if	O
there	O
are	O
any	O
empty	O
holes	O
that	O
are	O
larger	O
than	O
that	O
file	O
,	O
the	O
operating	O
system	O
can	O
avoid	O
data	B-Architecture
fragmentation	I-Architecture
by	O
putting	O
the	O
file	O
into	O
any	O
one	O
of	O
those	O
holes	O
.	O
</s>
<s>
Just	O
as	O
compaction	O
can	O
eliminate	O
external	O
fragmentation	B-Application
,	O
data	B-Architecture
fragmentation	I-Architecture
can	O
be	O
eliminated	O
by	O
rearranging	O
data	O
storage	O
so	O
that	O
related	O
pieces	O
are	O
close	O
together	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
primary	O
job	O
of	O
a	O
defragmentation	B-Application
tool	O
is	O
to	O
rearrange	O
blocks	B-General_Concept
on	O
disk	O
so	O
that	O
the	O
blocks	B-General_Concept
of	O
each	O
file	O
are	O
contiguous	B-Architecture
.	O
</s>
<s>
Most	O
defragmenting	B-Application
utilities	O
also	O
attempt	O
to	O
reduce	O
or	O
eliminate	O
free	O
space	O
fragmentation	B-Application
.	O
</s>
<s>
Some	O
moving	O
garbage	B-General_Concept
collectors	I-General_Concept
,	O
utilities	O
that	O
perform	O
automatic	B-General_Concept
memory	I-General_Concept
management	I-General_Concept
,	O
will	O
also	O
move	O
related	O
objects	O
close	O
together	O
(	O
this	O
is	O
called	O
compacting	O
)	O
to	O
improve	O
cache	O
performance	O
.	O
</s>
<s>
There	O
are	O
four	O
kinds	O
of	O
systems	O
that	O
never	O
experience	O
data	B-Architecture
fragmentation	I-Architecture
—	O
they	O
always	O
store	O
every	O
file	O
contiguously	B-Application
.	O
</s>
<s>
All	O
four	O
kinds	O
have	O
significant	O
disadvantages	O
compared	O
to	O
systems	O
that	O
allow	O
at	O
least	O
some	O
temporary	O
data	B-Architecture
fragmentation	I-Architecture
:	O
</s>
<s>
Simply	O
write	O
each	O
file	O
contiguously	B-Application
.	O
</s>
<s>
If	O
there	O
is	O
n't	O
already	O
enough	O
contiguous	B-Architecture
free	O
space	O
to	O
hold	O
the	O
file	O
,	O
the	O
system	O
immediately	O
fails	O
to	O
store	O
the	O
file	O
—	O
even	O
when	O
there	O
are	O
many	O
little	O
bits	O
of	O
free	O
space	O
from	O
deleted	O
files	O
that	O
add	O
up	O
to	O
more	O
than	O
enough	O
to	O
store	O
the	O
file	O
.	O
</s>
<s>
If	O
there	O
is	O
n't	O
already	O
enough	O
contiguous	B-Architecture
free	O
space	O
to	O
hold	O
the	O
file	O
,	O
use	O
a	O
copying	O
collector	O
to	O
convert	O
many	O
little	O
bits	O
of	O
free	O
space	O
into	O
one	O
contiguous	B-Architecture
free	O
region	O
big	O
enough	O
to	O
hold	O
the	O
file	O
.	O
</s>
<s>
Write	O
the	O
file	O
into	O
any	O
free	O
block	O
,	O
through	O
fixed-size	O
blocks	B-General_Concept
storage	O
.	O
</s>
<s>
If	O
a	O
programmer	O
picks	O
a	O
fixed	O
block	B-General_Concept
size	I-General_Concept
too	O
small	O
,	O
the	O
system	O
immediately	O
fails	O
to	O
store	O
some	O
files	O
—	O
files	O
larger	O
than	O
the	O
block	B-General_Concept
size	I-General_Concept
—	O
even	O
when	O
there	O
are	O
many	O
free	O
blocks	B-General_Concept
that	O
add	O
up	O
to	O
more	O
than	O
enough	O
to	O
store	O
the	O
file	O
.	O
</s>
<s>
If	O
a	O
programmer	O
picks	O
a	O
block	B-General_Concept
size	I-General_Concept
too	O
big	O
,	O
a	O
lot	O
of	O
space	O
is	O
wasted	O
on	O
internal	O
fragmentation	B-Application
.	O
</s>
<s>
Some	O
systems	O
avoid	O
dynamic	O
allocation	O
entirely	O
,	O
pre-storing	O
(	O
contiguous	B-Architecture
)	O
space	O
for	O
all	O
possible	O
files	O
they	O
will	O
need	O
—	O
for	O
example	O
,	O
MultiFinder	O
pre-allocates	O
a	O
chunk	O
of	O
RAM	O
to	O
each	O
application	O
as	O
it	O
was	O
started	O
according	O
to	O
how	O
much	O
RAM	O
that	O
application	O
's	O
programmer	O
claimed	O
it	O
would	O
need	O
.	O
</s>
<s>
Compared	O
to	O
external	O
fragmentation	B-Application
,	O
overhead	O
and	O
internal	O
fragmentation	B-Application
account	O
for	O
little	O
loss	O
in	O
terms	O
of	O
wasted	O
memory	O
and	O
reduced	O
performance	O
.	O
</s>
<s>
Fragmentation	B-Application
of	O
0%	O
means	O
that	O
all	O
the	O
free	O
memory	O
is	O
in	O
a	O
single	O
large	O
block	O
;	O
fragmentation	B-Application
is	O
90%	O
(	O
for	O
example	O
)	O
when	O
100	O
MB	O
free	O
memory	O
is	O
present	O
but	O
largest	O
free	O
block	O
of	O
memory	O
for	O
storage	O
is	O
just	O
10	O
MB	O
.	O
</s>
<s>
External	O
fragmentation	B-Application
tends	O
to	O
be	O
less	O
of	O
a	O
problem	O
in	O
file	B-Application
systems	I-Application
than	O
in	O
primary	O
memory	O
(	O
RAM	O
)	O
storage	B-General_Concept
systems	I-General_Concept
,	O
because	O
programs	O
usually	O
require	O
their	O
RAM	O
storage	O
requests	O
to	O
be	O
fulfilled	O
with	O
contiguous	B-Architecture
blocks	B-General_Concept
,	O
but	O
file	B-Application
systems	I-Application
typically	O
are	O
designed	O
to	O
be	O
able	O
to	O
use	O
any	O
collection	O
of	O
available	O
blocks	B-General_Concept
(	O
fragments	O
)	O
to	O
assemble	O
a	O
file	O
which	O
logically	O
appears	O
contiguous	B-Architecture
.	O
</s>
<s>
In	O
RAM	O
,	O
on	O
the	O
other	O
hand	O
,	O
the	O
storage	B-General_Concept
systems	I-General_Concept
used	O
often	O
cannot	O
assemble	O
a	O
large	O
block	O
to	O
meet	O
a	O
request	O
from	O
small	O
noncontiguous	O
free	O
blocks	B-General_Concept
,	O
and	O
so	O
the	O
request	O
cannot	O
be	O
fulfilled	O
and	O
the	O
program	O
cannot	O
proceed	O
to	O
do	O
whatever	O
it	O
needed	O
that	O
memory	O
for	O
(	O
unless	O
it	O
can	O
reissue	O
the	O
request	O
as	O
a	O
number	O
of	O
smaller	O
separate	O
requests	O
)	O
.	O
</s>
<s>
The	O
most	O
severe	O
problem	O
caused	O
by	O
fragmentation	B-Application
is	O
causing	O
a	O
process	O
or	O
system	O
to	O
fail	O
,	O
due	O
to	O
premature	O
resource	O
exhaustion	O
:	O
if	O
a	O
contiguous	B-Architecture
block	O
must	O
be	O
stored	O
and	O
cannot	O
be	O
stored	O
,	O
failure	O
occurs	O
.	O
</s>
<s>
Fragmentation	B-Application
causes	O
this	O
to	O
occur	O
even	O
if	O
there	O
is	O
enough	O
of	O
the	O
resource	O
,	O
but	O
not	O
a	O
contiguous	B-Architecture
amount	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
a	O
computer	O
has	O
4	O
GiB	O
of	O
memory	O
and	O
2	O
GiB	O
are	O
free	O
,	O
but	O
the	O
memory	O
is	O
fragmented	O
in	O
an	O
alternating	O
sequence	O
of	O
1	O
MiB	O
used	O
,	O
1	O
MiB	O
free	O
,	O
then	O
a	O
request	O
for	O
1	O
contiguous	B-Architecture
GiB	O
of	O
memory	O
cannot	O
be	O
satisfied	O
even	O
though	O
2	O
GiB	O
total	O
are	O
free	O
.	O
</s>
<s>
In	O
order	O
to	O
avoid	O
this	O
,	O
the	O
allocator	O
may	O
,	O
instead	O
of	O
failing	O
,	O
trigger	O
a	O
defragmentation	B-Application
(	O
or	O
memory	O
compaction	O
cycle	O
)	O
or	O
other	O
resource	O
reclamation	O
,	O
such	O
as	O
a	O
major	O
garbage	B-General_Concept
collection	I-General_Concept
cycle	O
,	O
in	O
the	O
hope	O
that	O
it	O
will	O
then	O
be	O
able	O
to	O
satisfy	O
the	O
request	O
.	O
</s>
<s>
Fragmentation	B-Application
causes	O
performance	O
degradation	O
for	O
a	O
number	O
of	O
reasons	O
.	O
</s>
<s>
Most	O
basically	O
,	O
fragmentation	B-Application
increases	O
the	O
work	O
required	O
to	O
allocate	O
and	O
access	O
a	O
resource	O
.	O
</s>
<s>
However	O
it	O
is	O
fragmented	O
,	O
the	O
request	O
requires	O
either	O
searching	O
for	O
a	O
large	O
enough	O
free	O
block	O
,	O
which	O
may	O
take	O
a	O
long	O
time	O
,	O
or	O
fulfilling	O
the	O
request	O
by	O
several	O
smaller	O
blocks	B-General_Concept
(	O
if	O
this	O
is	O
possible	O
)	O
,	O
which	O
results	O
in	O
this	O
allocation	O
being	O
fragmented	O
,	O
and	O
requiring	O
additional	O
overhead	O
to	O
manage	O
the	O
several	O
pieces	O
.	O
</s>
<s>
A	O
subtler	O
problem	O
is	O
that	O
fragmentation	B-Application
may	O
prematurely	O
exhaust	O
a	O
cache	O
,	O
causing	O
thrashing	B-General_Concept
,	O
due	O
to	O
caches	O
holding	O
blocks	B-General_Concept
,	O
not	O
individual	O
data	O
.	O
</s>
<s>
For	O
example	O
,	O
suppose	O
a	O
program	O
has	O
a	O
working	B-General_Concept
set	I-General_Concept
of	O
256	O
KiB	O
,	O
and	O
is	O
running	O
on	O
a	O
computer	O
with	O
a	O
256	O
KiB	O
cache	O
(	O
say	O
L2	O
instruction+data	O
cache	O
)	O
,	O
so	O
the	O
entire	O
working	B-General_Concept
set	I-General_Concept
fits	O
in	O
cache	O
and	O
thus	O
executes	O
quickly	O
,	O
at	O
least	O
in	O
terms	O
of	O
cache	O
hits	O
.	O
</s>
<s>
Suppose	O
further	O
that	O
it	O
has	O
64	O
translation	B-Architecture
lookaside	I-Architecture
buffer	I-Architecture
(	O
TLB	O
)	O
entries	O
,	O
each	O
for	O
a	O
4	O
KiB	O
page	B-General_Concept
:	O
each	O
memory	O
access	O
requires	O
a	O
virtual-to-physical	O
translation	O
,	O
which	O
is	O
fast	O
if	O
the	O
page	B-General_Concept
is	O
in	O
cache	O
(	O
here	O
TLB	O
)	O
.	O
</s>
<s>
If	O
the	O
working	B-General_Concept
set	I-General_Concept
is	O
unfragmented	O
,	O
then	O
it	O
will	O
fit	O
onto	O
exactly	O
64	O
pages	O
(	O
the	O
page	B-General_Concept
working	B-General_Concept
set	I-General_Concept
will	O
be	O
64	O
pages	O
)	O
,	O
and	O
all	O
memory	O
lookups	O
can	O
be	O
served	O
from	O
cache	O
.	O
</s>
<s>
However	O
,	O
if	O
the	O
working	B-General_Concept
set	I-General_Concept
is	O
fragmented	O
,	O
then	O
it	O
will	O
not	O
fit	O
into	O
64	O
pages	O
,	O
and	O
execution	O
will	O
slow	O
due	O
to	O
thrashing	B-General_Concept
:	O
pages	O
will	O
be	O
repeatedly	O
added	O
and	O
removed	O
from	O
the	O
TLB	O
during	O
operation	O
.	O
</s>
<s>
Thus	O
cache	O
sizing	O
in	O
system	O
design	O
must	O
include	O
margin	O
to	O
account	O
for	O
fragmentation	B-Application
.	O
</s>
<s>
Memory	B-Architecture
fragmentation	I-Architecture
is	O
one	O
of	O
the	O
most	O
severe	O
problems	O
faced	O
by	O
system	O
managers	O
.	O
</s>
<s>
Eventually	O
,	O
memory	B-Architecture
fragmentation	I-Architecture
may	O
lead	O
to	O
complete	O
loss	O
of	O
(	O
application-usable	O
)	O
free	O
memory	O
.	O
</s>
<s>
Memory	B-Architecture
fragmentation	I-Architecture
is	O
a	O
kernel	B-Operating_System
programming	B-General_Concept
level	O
problem	O
.	O
</s>
<s>
During	O
real-time	B-General_Concept
computing	I-General_Concept
of	O
applications	O
,	O
fragmentation	B-Application
levels	O
can	O
reach	O
as	O
high	O
as	O
99%	O
,	O
and	O
may	O
lead	O
to	O
system	O
crashes	O
or	O
other	O
instabilities	O
.	O
</s>
<s>
This	O
type	O
of	O
system	O
crash	O
can	O
be	O
difficult	O
to	O
avoid	O
,	O
as	O
it	O
is	O
impossible	O
to	O
anticipate	O
the	O
critical	O
rise	O
in	O
levels	O
of	O
memory	B-Architecture
fragmentation	I-Architecture
.	O
</s>
<s>
However	O
,	O
while	O
it	O
may	O
not	O
be	O
possible	O
for	O
a	O
system	O
to	O
continue	O
running	O
all	O
programs	O
in	O
the	O
case	O
of	O
excessive	O
memory	B-Architecture
fragmentation	I-Architecture
,	O
a	O
well-designed	O
system	O
should	O
be	O
able	O
to	O
recover	O
from	O
the	O
critical	O
fragmentation	B-Application
condition	O
by	O
moving	O
in	O
some	O
memory	O
blocks	B-General_Concept
used	O
by	O
the	O
system	O
itself	O
in	O
order	O
to	O
enable	O
consolidation	O
of	O
free	O
memory	O
into	O
fewer	O
,	O
larger	O
blocks	B-General_Concept
,	O
or	O
,	O
in	O
the	O
worst	O
case	O
,	O
by	O
terminating	O
some	O
programs	O
to	O
free	O
their	O
memory	O
and	O
then	O
defragmenting	B-Application
the	O
resulting	O
sum	O
total	O
of	O
free	O
memory	O
.	O
</s>
<s>
It	O
is	O
also	O
important	O
to	O
note	O
that	O
fragmentation	B-Application
is	O
a	O
phenomenon	O
of	O
system	O
software	O
design	O
;	O
different	O
software	O
will	O
be	O
susceptible	O
to	O
fragmentation	B-Application
to	O
different	O
degrees	O
,	O
and	O
it	O
is	O
possible	O
to	O
design	O
a	O
system	O
that	O
will	O
never	O
be	O
forced	O
to	O
shut	O
down	O
or	O
kill	O
processes	O
as	O
a	O
result	O
of	O
memory	B-Architecture
fragmentation	I-Architecture
.	O
</s>
<s>
While	O
fragmentation	B-Application
is	O
best	O
known	O
as	O
a	O
problem	O
in	O
memory	B-General_Concept
allocation	I-General_Concept
,	O
analogous	O
phenomena	O
occur	O
for	O
other	O
resources	B-General_Concept
,	O
notably	O
processors	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
a	O
system	O
that	O
uses	O
time-sharing	B-General_Concept
for	O
preemptive	O
multitasking	O
,	O
but	O
that	O
does	O
not	O
check	O
if	O
a	O
process	O
is	O
blocked	O
,	O
a	O
process	O
that	O
executes	O
for	O
part	O
of	O
its	O
time	O
slice	O
but	O
then	O
blocks	B-General_Concept
and	O
cannot	O
proceed	O
for	O
the	O
remainder	O
of	O
its	O
time	O
slice	O
wastes	O
time	O
because	O
of	O
the	O
resulting	O
internal	O
fragmentation	B-Application
of	O
time	O
slices	O
.	O
</s>
<s>
More	O
fundamentally	O
,	O
time-sharing	B-General_Concept
itself	O
causes	O
external	O
fragmentation	B-Application
of	O
processes	O
due	O
to	O
running	O
them	O
in	O
fragmented	O
time	O
slices	O
,	O
rather	O
than	O
in	O
a	O
single	O
unbroken	O
run	O
.	O
</s>
<s>
In	O
concurrent	B-Operating_System
systems	I-Operating_System
,	O
particularly	O
distributed	B-Architecture
systems	I-Architecture
,	O
when	O
a	O
group	O
of	O
processes	O
must	O
interact	O
in	O
order	O
to	O
progress	O
,	O
if	O
the	O
processes	O
are	O
scheduled	O
at	O
separate	O
times	O
or	O
on	O
separate	O
machines	O
(	O
fragmented	O
across	O
time	O
or	O
machines	O
)	O
,	O
the	O
time	O
spent	O
waiting	O
for	O
each	O
other	O
or	O
in	O
communicating	O
with	O
each	O
other	O
can	O
severely	O
degrade	O
performance	O
.	O
</s>
<s>
Instead	O
,	O
performant	O
systems	O
require	O
coscheduling	B-Operating_System
of	O
the	O
group	O
.	O
</s>
<s>
Some	O
flash	B-Application
file	I-Application
systems	I-Application
have	O
several	O
different	O
kinds	O
of	O
internal	O
fragmentation	B-Application
involving	O
"	O
dead	O
space	O
"	O
and	O
"	O
dark	O
space	O
.	O
</s>
