<s>
In	O
computing	O
,	O
shadow	B-General_Concept
memory	I-General_Concept
is	O
a	O
technique	O
used	O
to	O
track	O
and	O
store	O
information	O
on	O
computer	B-General_Concept
memory	I-General_Concept
used	O
by	O
a	O
program	B-Application
during	O
its	O
execution	O
.	O
</s>
<s>
Shadow	B-General_Concept
memory	I-General_Concept
consists	O
of	O
shadow	O
bytes	O
that	O
map	O
to	O
individual	O
bits	O
or	O
one	O
or	O
more	O
bytes	O
in	O
main	O
memory	O
.	O
</s>
<s>
These	O
shadow	O
bytes	O
are	O
typically	O
invisible	O
to	O
the	O
original	O
program	B-Application
and	O
are	O
used	O
to	O
record	O
information	O
about	O
the	O
original	O
piece	O
of	O
data	O
.	O
</s>
<s>
The	O
technique	O
is	O
utilized	O
by	O
memory-error	O
checkers	O
that	O
can	O
store	O
information	O
on	O
which	O
parts	O
of	O
memory	O
have	O
been	O
allocated	O
to	O
the	O
program	B-Application
being	O
checked	O
.	O
</s>
<s>
This	O
shadow	B-General_Concept
memory	I-General_Concept
is	O
then	O
used	O
for	O
detecting	O
and	O
reporting	O
incorrect	O
accesses	O
of	O
memory	O
,	O
even	O
though	O
the	O
program	B-Application
may	O
not	O
be	O
crashing	O
due	O
to	O
a	O
segmentation	B-Error_Name
fault	I-Error_Name
or	O
similar	O
.	O
</s>
<s>
Memcheck	O
,	O
part	O
of	O
the	O
Valgrind	B-Application
suite	O
,	O
uses	O
this	O
to	O
detect	O
undefined	O
behavior	O
resulting	O
from	O
acting	O
on	O
or	O
printing	O
undefined	O
memory	O
values	O
.	O
</s>
<s>
Use	O
of	O
shadow	B-General_Concept
memory	I-General_Concept
is	O
however	O
not	O
limited	O
to	O
memory-error	O
checkers	O
,	O
as	O
what	O
information	O
is	O
stored	O
in	O
these	O
shadow	O
bytes	O
is	O
not	O
fixed	O
.	O
</s>
<s>
Shadow	B-General_Concept
memory	I-General_Concept
can	O
be	O
both	O
implemented	O
and	O
used	O
a	O
lot	O
of	O
different	O
ways	O
,	O
and	O
have	O
different	O
performance	O
characteristics	O
.	O
</s>
<s>
Memcheck	O
for	O
instance	O
tracks	O
values	O
with	O
bit	O
precision	O
,	O
while	O
AddressSanitizer	B-Application
,	O
part	O
of	O
the	O
clang	B-Application
compiler	O
,	O
is	O
comparatively	O
very	O
fast	O
.	O
</s>
<s>
Memcheck	O
,	O
like	O
all	O
Valgrind	B-Application
tools	O
,	O
uses	O
binary	O
translation	O
and	O
instrumentation	B-Application
to	O
run	O
code	O
manipulating	O
the	O
shadow	B-General_Concept
memory	I-General_Concept
corresponding	O
to	O
program	B-Application
memory	O
use	O
.	O
</s>
<s>
AddressSanitizer	B-Application
on	O
the	O
other	O
hand	O
is	O
created	O
on	O
compile-time	O
and	O
inserts	O
error-checking	O
code	O
inline	O
into	O
a	O
program	B-Application
during	O
compilation	O
.	O
</s>
<s>
Its	O
shadow-memory	O
implementation	O
uses	O
a	O
huge	O
reservation	O
of	O
virtual	O
memory	O
for	O
its	O
shadow	B-General_Concept
memory	I-General_Concept
,	O
giving	O
very	O
different	O
performance	O
characteristics	O
.	O
</s>
