<s>
In	O
computer	B-General_Concept
science	I-General_Concept
,	O
a	O
memory	B-General_Concept
leak	O
is	O
a	O
type	O
of	O
resource	O
leak	O
that	O
occurs	O
when	O
a	O
computer	B-Application
program	I-Application
incorrectly	O
manages	O
memory	B-General_Concept
allocations	I-General_Concept
in	O
a	O
way	O
that	O
memory	B-General_Concept
which	O
is	O
no	O
longer	O
needed	O
is	O
not	O
released	O
.	O
</s>
<s>
A	O
memory	B-General_Concept
leak	O
may	O
also	O
happen	O
when	O
an	O
object	O
is	O
stored	O
in	O
memory	B-General_Concept
but	O
cannot	O
be	O
accessed	O
by	O
the	O
running	O
code	O
(	O
i.e.	O
</s>
<s>
unreachable	B-General_Concept
memory	I-General_Concept
)	O
.	O
</s>
<s>
A	O
memory	B-General_Concept
leak	O
has	O
symptoms	O
similar	O
to	O
a	O
number	O
of	O
other	O
problems	O
and	O
generally	O
can	O
only	O
be	O
diagnosed	O
by	O
a	O
programmer	O
with	O
access	O
to	O
the	O
program	O
's	O
source	O
code	O
.	O
</s>
<s>
A	O
related	O
concept	O
is	O
the	O
"	O
space	B-Application
leak	I-Application
"	O
,	O
which	O
is	O
when	O
a	O
program	O
consumes	O
excessive	O
memory	B-General_Concept
but	O
does	O
eventually	O
release	O
it	O
.	O
</s>
<s>
Because	O
they	O
can	O
exhaust	O
available	O
system	O
memory	B-General_Concept
as	O
an	O
application	O
runs	O
,	O
memory	B-General_Concept
leaks	O
are	O
often	O
the	O
cause	O
of	O
or	O
a	O
contributing	O
factor	O
to	O
software	B-General_Concept
aging	I-General_Concept
.	O
</s>
<s>
A	O
memory	B-General_Concept
leak	O
reduces	O
the	O
performance	O
of	O
the	O
computer	O
by	O
reducing	O
the	O
amount	O
of	O
available	O
memory	B-General_Concept
.	O
</s>
<s>
Eventually	O
,	O
in	O
the	O
worst	O
case	O
,	O
too	O
much	O
of	O
the	O
available	O
memory	B-General_Concept
may	O
become	O
allocated	O
and	O
all	O
or	O
part	O
of	O
the	O
system	O
or	O
device	O
stops	O
working	O
correctly	O
,	O
the	O
application	O
fails	O
,	O
or	O
the	O
system	O
slows	O
down	O
vastly	O
due	O
to	O
thrashing	B-General_Concept
.	O
</s>
<s>
Memory	B-General_Concept
leaks	O
may	O
not	O
be	O
serious	O
or	O
even	O
detectable	O
by	O
normal	O
means	O
.	O
</s>
<s>
In	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
,	O
normal	O
memory	B-General_Concept
used	O
by	O
an	O
application	O
is	O
released	O
when	O
the	O
application	O
terminates	O
.	O
</s>
<s>
This	O
means	O
that	O
a	O
memory	B-General_Concept
leak	O
in	O
a	O
program	O
that	O
only	O
runs	O
for	O
a	O
short	O
time	O
may	O
not	O
be	O
noticed	O
and	O
is	O
rarely	O
serious	O
.	O
</s>
<s>
running	O
on	O
an	O
operating	B-General_Concept
system	I-General_Concept
that	O
does	O
not	O
automatically	O
release	O
memory	B-General_Concept
on	O
program	O
termination	O
.	O
</s>
<s>
The	O
following	O
example	O
,	O
written	O
in	O
pseudocode	B-Language
,	O
is	O
intended	O
to	O
show	O
how	O
a	O
memory	B-General_Concept
leak	O
can	O
come	O
about	O
,	O
and	O
its	O
effects	O
,	O
without	O
needing	O
any	O
programming	O
knowledge	O
.	O
</s>
<s>
The	O
memory	B-General_Concept
leak	O
would	O
occur	O
if	O
the	O
floor	O
number	O
requested	O
is	O
the	O
same	O
floor	O
that	O
the	O
elevator	O
is	O
on	O
;	O
the	O
condition	O
for	O
releasing	O
the	O
memory	B-General_Concept
would	O
be	O
skipped	O
.	O
</s>
<s>
Each	O
time	O
this	O
case	O
occurs	O
,	O
more	O
memory	B-General_Concept
is	O
leaked	O
.	O
</s>
<s>
People	O
do	O
not	O
often	O
press	O
the	O
button	O
for	O
the	O
floor	O
they	O
are	O
already	O
on	O
,	O
and	O
in	O
any	O
case	O
,	O
the	O
elevator	O
might	O
have	O
enough	O
spare	O
memory	B-General_Concept
that	O
this	O
could	O
happen	O
hundreds	O
or	O
thousands	O
of	O
times	O
.	O
</s>
<s>
However	O
,	O
the	O
elevator	O
will	O
eventually	O
run	O
out	O
of	O
memory	B-General_Concept
.	O
</s>
<s>
If	O
other	O
parts	O
of	O
the	O
program	O
need	O
memory	B-General_Concept
(	O
a	O
part	O
assigned	O
to	O
open	O
and	O
close	O
the	O
door	O
,	O
for	O
example	O
)	O
,	O
then	O
no	O
one	O
would	O
be	O
able	O
to	O
enter	O
,	O
and	O
if	O
someone	O
happens	O
to	O
be	O
inside	O
,	O
they	O
will	O
become	O
trapped	O
(	O
assuming	O
the	O
doors	O
cannot	O
be	O
opened	O
manually	O
)	O
.	O
</s>
<s>
The	O
memory	B-General_Concept
leak	O
lasts	O
until	O
the	O
system	O
is	O
reset	O
.	O
</s>
<s>
When	O
power	O
was	O
turned	O
on	O
again	O
,	O
the	O
program	O
would	O
restart	O
and	O
all	O
the	O
memory	B-General_Concept
would	O
be	O
available	O
again	O
,	O
but	O
the	O
slow	O
process	O
of	O
memory	B-General_Concept
leak	O
would	O
restart	O
together	O
with	O
the	O
program	O
,	O
eventually	O
prejudicing	O
the	O
correct	O
running	O
of	O
the	O
system	O
.	O
</s>
<s>
Memory	B-General_Concept
leaks	O
are	O
a	O
common	O
error	O
in	O
programming	O
,	O
especially	O
when	O
using	O
languages	O
that	O
have	O
no	O
built	O
in	O
automatic	B-General_Concept
garbage	I-General_Concept
collection	I-General_Concept
,	O
such	O
as	O
C	B-Language
and	O
C++	B-Language
.	O
</s>
<s>
Typically	O
,	O
a	O
memory	B-General_Concept
leak	O
occurs	O
because	O
dynamically	B-General_Concept
allocated	I-General_Concept
memory	B-General_Concept
has	O
become	O
unreachable	B-General_Concept
.	O
</s>
<s>
The	O
prevalence	O
of	O
memory	B-General_Concept
leak	O
bugs	B-Error_Name
has	O
led	O
to	O
the	O
development	O
of	O
a	O
number	O
of	O
debugging	O
tools	O
to	O
detect	O
unreachable	B-General_Concept
memory	I-General_Concept
.	O
</s>
<s>
BoundsChecker	B-General_Concept
,	O
Deleaker	O
,	O
Memory	B-General_Concept
Validator	O
,	O
IBM	B-General_Concept
Rational	I-General_Concept
Purify	I-General_Concept
,	O
Valgrind	B-Application
,	O
Parasoft	O
Insure++	B-General_Concept
,	O
Dr.	O
Memory	B-General_Concept
and	O
memwatch	B-Application
are	O
some	O
of	O
the	O
more	O
popular	O
memory	B-General_Concept
debuggers	I-General_Concept
for	O
C	B-Language
and	O
C++	B-Language
programs	I-Language
.	O
</s>
<s>
"	O
Conservative	O
"	O
garbage	B-General_Concept
collection	I-General_Concept
capabilities	O
can	O
be	O
added	O
to	O
any	O
programming	O
language	O
that	O
lacks	O
it	O
as	O
a	O
built-in	O
feature	O
,	O
and	O
libraries	O
for	O
doing	O
this	O
are	O
available	O
for	O
C	B-Language
and	O
C++	B-Language
programs	I-Language
.	O
</s>
<s>
A	O
conservative	O
collector	O
finds	O
and	O
reclaims	O
most	O
,	O
but	O
not	O
all	O
,	O
unreachable	B-General_Concept
memory	I-General_Concept
.	O
</s>
<s>
Although	O
the	O
memory	B-General_Concept
manager	I-General_Concept
can	O
recover	O
unreachable	B-General_Concept
memory	I-General_Concept
,	O
it	O
cannot	O
free	O
memory	B-General_Concept
that	O
is	O
still	O
reachable	O
and	O
therefore	O
potentially	O
still	O
useful	O
.	O
</s>
<s>
Modern	O
memory	B-General_Concept
managers	O
therefore	O
provide	O
techniques	O
for	O
programmers	O
to	O
semantically	O
mark	O
memory	B-General_Concept
with	O
varying	O
levels	O
of	O
usefulness	O
,	O
which	O
correspond	O
to	O
varying	O
levels	O
of	O
reachability	O
.	O
</s>
<s>
The	O
memory	B-General_Concept
manager	I-General_Concept
does	O
not	O
free	O
an	O
object	O
that	O
is	O
strongly	O
reachable	O
.	O
</s>
<s>
An	O
object	O
is	O
strongly	O
reachable	O
if	O
it	O
is	O
reachable	O
either	O
directly	O
by	O
a	O
strong	B-General_Concept
reference	I-General_Concept
or	O
indirectly	O
by	O
a	O
chain	O
of	O
strong	B-General_Concept
references	I-General_Concept
.	O
</s>
<s>
(	O
A	O
strong	B-General_Concept
reference	I-General_Concept
is	O
a	O
reference	O
that	O
,	O
unlike	O
a	O
weak	B-General_Concept
reference	I-General_Concept
,	O
prevents	O
an	O
object	O
from	O
being	O
garbage	B-General_Concept
collected	I-General_Concept
.	O
)	O
</s>
<s>
To	O
prevent	O
this	O
,	O
the	O
developer	O
is	O
responsible	O
for	O
cleaning	O
up	O
references	O
after	O
use	O
,	O
typically	O
by	O
setting	O
the	O
reference	O
to	O
null	O
once	O
it	O
is	O
no	O
longer	O
needed	O
and	O
,	O
if	O
necessary	O
,	O
by	O
deregistering	O
any	O
event	O
listeners	O
that	O
maintain	O
strong	B-General_Concept
references	I-General_Concept
to	O
the	O
object	O
.	O
</s>
<s>
In	O
general	O
,	O
automatic	B-General_Concept
memory	I-General_Concept
management	I-General_Concept
is	O
more	O
robust	O
and	O
convenient	O
for	O
developers	O
,	O
as	O
they	O
do	O
not	O
need	O
to	O
implement	O
freeing	O
routines	O
or	O
worry	O
about	O
the	O
sequence	O
in	O
which	O
cleanup	O
is	O
performed	O
or	O
be	O
concerned	O
about	O
whether	O
or	O
not	O
an	O
object	O
is	O
still	O
referenced	O
.	O
</s>
<s>
However	O
,	O
automatic	B-General_Concept
memory	I-General_Concept
management	I-General_Concept
can	O
impose	O
a	O
performance	O
overhead	O
,	O
and	O
it	O
does	O
not	O
eliminate	O
all	O
of	O
the	O
programming	B-Error_Name
errors	I-Error_Name
that	O
cause	O
memory	B-General_Concept
leaks	O
.	O
</s>
<s>
Resource	B-Application
acquisition	I-Application
is	I-Application
initialization	I-Application
(	O
RAII	B-Application
)	O
is	O
an	O
approach	O
to	O
the	O
problem	O
commonly	O
taken	O
in	O
C++	B-Language
,	O
D	B-Application
,	O
and	O
Ada	B-Language
.	O
</s>
<s>
Unlike	O
garbage	B-General_Concept
collection	I-General_Concept
,	O
RAII	B-Application
has	O
the	O
advantage	O
of	O
knowing	O
when	O
objects	O
exist	O
and	O
when	O
they	O
do	O
not	O
.	O
</s>
<s>
Compare	O
the	O
following	O
C	B-Language
and	O
C++	B-Language
examples	O
:	O
</s>
<s>
The	O
C	B-Language
version	O
,	O
as	O
implemented	O
in	O
the	O
example	O
,	O
requires	O
explicit	O
deallocation	B-General_Concept
;	O
the	O
array	O
is	O
dynamically	B-General_Concept
allocated	I-General_Concept
(	O
from	O
the	O
heap	O
in	O
most	O
C	B-Language
implementations	O
)	O
,	O
and	O
continues	O
to	O
exist	O
until	O
explicitly	O
freed	O
.	O
</s>
<s>
The	O
C++	B-Language
version	O
requires	O
no	O
explicit	O
deallocation	B-General_Concept
;	O
it	O
will	O
always	O
occur	O
automatically	O
as	O
soon	O
as	O
the	O
object	O
array	O
goes	O
out	O
of	O
scope	O
,	O
including	O
if	O
an	O
exception	O
is	O
thrown	O
.	O
</s>
<s>
This	O
avoids	O
some	O
of	O
the	O
overhead	O
of	O
garbage	B-General_Concept
collection	I-General_Concept
schemes	O
.	O
</s>
<s>
And	O
because	O
object	O
destructors	O
can	O
free	O
resources	O
other	O
than	O
memory	B-General_Concept
,	O
RAII	B-Application
helps	O
to	O
prevent	O
the	O
leaking	B-General_Concept
of	I-General_Concept
input	I-General_Concept
and	I-General_Concept
output	I-General_Concept
resources	I-General_Concept
accessed	I-General_Concept
through	I-General_Concept
a	I-General_Concept
handle	I-General_Concept
,	O
which	O
mark-and-sweep	O
garbage	B-General_Concept
collection	I-General_Concept
does	O
not	O
handle	O
gracefully	O
.	O
</s>
<s>
These	O
include	O
open	O
files	O
,	O
open	O
windows	O
,	O
user	O
notifications	O
,	O
objects	O
in	O
a	O
graphics	O
drawing	O
library	O
,	O
thread	O
synchronisation	O
primitives	O
such	O
as	O
critical	O
sections	O
,	O
network	O
connections	O
,	O
and	O
connections	O
to	O
the	O
Windows	B-Protocol
Registry	I-Protocol
or	O
another	O
database	O
.	O
</s>
<s>
However	O
,	O
using	O
RAII	B-Application
correctly	O
is	O
not	O
always	O
easy	O
and	O
has	O
its	O
own	O
pitfalls	O
.	O
</s>
<s>
For	O
instance	O
,	O
if	O
one	O
is	O
not	O
careful	O
,	O
it	O
is	O
possible	O
to	O
create	O
dangling	B-Error_Name
pointers	I-Error_Name
(	O
or	O
references	O
)	O
by	O
returning	O
data	O
by	O
reference	O
,	O
only	O
to	O
have	O
that	O
data	O
be	O
deleted	O
when	O
its	O
containing	O
object	O
goes	O
out	O
of	O
scope	O
.	O
</s>
<s>
D	B-Application
uses	O
a	O
combination	O
of	O
RAII	B-Application
and	O
garbage	B-General_Concept
collection	I-General_Concept
,	O
employing	O
automatic	O
destruction	O
when	O
it	O
is	O
clear	O
that	O
an	O
object	O
cannot	O
be	O
accessed	O
outside	O
its	O
original	O
scope	O
,	O
and	O
garbage	B-General_Concept
collection	I-General_Concept
otherwise	O
.	O
</s>
<s>
More	O
modern	O
garbage	B-General_Concept
collection	I-General_Concept
schemes	O
are	O
often	O
based	O
on	O
a	O
notion	O
of	O
reachability	O
–	O
if	O
you	O
do	O
not	O
have	O
a	O
usable	O
reference	O
to	O
the	O
memory	B-General_Concept
in	O
question	O
,	O
it	O
can	O
be	O
collected	O
.	O
</s>
<s>
Other	O
garbage	B-General_Concept
collection	I-General_Concept
schemes	O
can	O
be	O
based	O
on	O
reference	B-General_Concept
counting	I-General_Concept
,	O
where	O
an	O
object	O
is	O
responsible	O
for	O
keeping	O
track	O
of	O
how	O
many	O
references	O
are	O
pointing	O
to	O
it	O
.	O
</s>
<s>
If	O
the	O
number	O
goes	O
down	O
to	O
zero	O
,	O
the	O
object	O
is	O
expected	O
to	O
release	O
itself	O
and	O
allow	O
its	O
memory	B-General_Concept
to	O
be	O
reclaimed	O
.	O
</s>
<s>
The	O
following	O
Visual	B-Language
Basic	I-Language
code	O
illustrates	O
the	O
canonical	O
reference-counting	O
memory	B-General_Concept
leak	O
:	O
</s>
<s>
A	O
well-known	O
example	O
of	O
this	O
kind	O
of	O
leak	O
came	O
to	O
prominence	O
with	O
the	O
rise	O
of	O
AJAX	B-Device
programming	O
techniques	O
in	O
web	B-Application
browsers	I-Application
in	O
the	O
lapsed	B-Error_Name
listener	I-Error_Name
problem	I-Error_Name
.	O
</s>
<s>
JavaScript	B-Language
code	O
which	O
associated	O
a	O
DOM	B-General_Concept
element	O
with	O
an	O
event	O
handler	O
,	O
and	O
failed	O
to	O
remove	O
the	O
reference	O
before	O
exiting	O
,	O
would	O
leak	O
memory	B-General_Concept
(	O
AJAX	B-Device
web	O
pages	B-Architecture
keep	O
a	O
given	O
DOM	B-General_Concept
alive	O
for	O
a	O
lot	O
longer	O
than	O
traditional	O
web	O
pages	B-Architecture
,	O
so	O
this	O
leak	O
was	O
much	O
more	O
apparent	O
)	O
.	O
</s>
<s>
If	O
a	O
program	O
has	O
a	O
memory	B-General_Concept
leak	O
and	O
its	O
memory	B-General_Concept
usage	I-General_Concept
is	O
steadily	O
increasing	O
,	O
there	O
will	O
not	O
usually	O
be	O
an	O
immediate	O
symptom	O
.	O
</s>
<s>
Every	O
physical	O
system	O
has	O
a	O
finite	O
amount	O
of	O
memory	B-General_Concept
,	O
and	O
if	O
the	O
memory	B-General_Concept
leak	O
is	O
not	O
contained	O
(	O
for	O
example	O
,	O
by	O
restarting	O
the	O
leaking	O
program	O
)	O
it	O
will	O
eventually	O
cause	O
problems	O
.	O
</s>
<s>
Most	O
modern	O
consumer	O
desktop	B-General_Concept
operating	I-General_Concept
systems	I-General_Concept
have	O
both	O
main	O
memory	B-General_Concept
which	O
is	O
physically	O
housed	O
in	O
RAM	O
microchips	O
,	O
and	O
secondary	O
storage	O
such	O
as	O
a	O
hard	B-Device
drive	I-Device
.	O
</s>
<s>
Memory	B-General_Concept
allocation	I-General_Concept
is	O
dynamic	O
–	O
each	O
process	O
gets	O
as	O
much	O
memory	B-General_Concept
as	O
it	O
requests	O
.	O
</s>
<s>
Active	O
pages	B-Architecture
are	O
transferred	O
into	O
main	O
memory	B-General_Concept
for	O
fast	O
access	O
;	O
inactive	O
pages	B-Architecture
are	O
pushed	O
out	O
to	O
secondary	O
storage	O
to	O
make	O
room	O
,	O
as	O
needed	O
.	O
</s>
<s>
When	O
a	O
single	O
process	O
starts	O
consuming	O
a	O
large	O
amount	O
of	O
memory	B-General_Concept
,	O
it	O
usually	O
occupies	O
more	O
and	O
more	O
of	O
main	O
memory	B-General_Concept
,	O
pushing	O
other	O
programs	O
out	O
to	O
secondary	O
storage	O
–	O
usually	O
significantly	O
slowing	O
performance	O
of	O
the	O
system	O
.	O
</s>
<s>
Even	O
if	O
the	O
leaking	O
program	O
is	O
terminated	O
,	O
it	O
may	O
take	O
some	O
time	O
for	O
other	O
programs	O
to	O
swap	O
back	O
into	O
main	O
memory	B-General_Concept
,	O
and	O
for	O
performance	O
to	O
return	O
to	O
normal	O
.	O
</s>
<s>
When	O
all	O
the	O
memory	B-General_Concept
on	O
a	O
system	O
is	O
exhausted	O
(	O
whether	O
there	O
is	O
virtual	O
memory	B-General_Concept
or	O
only	O
main	O
memory	B-General_Concept
,	O
such	O
as	O
on	O
an	O
embedded	B-Architecture
system	I-Architecture
)	O
any	O
attempt	O
to	O
allocate	O
more	O
memory	B-General_Concept
will	O
fail	O
.	O
</s>
<s>
This	O
usually	O
causes	O
the	O
program	O
attempting	O
to	O
allocate	O
the	O
memory	B-General_Concept
to	O
terminate	O
itself	O
,	O
or	O
to	O
generate	O
a	O
segmentation	B-Error_Name
fault	I-Error_Name
.	O
</s>
<s>
Some	O
programs	O
are	O
designed	O
to	O
recover	O
from	O
this	O
situation	O
(	O
possibly	O
by	O
falling	O
back	O
on	O
pre-reserved	O
memory	B-General_Concept
)	O
.	O
</s>
<s>
The	O
first	O
program	O
to	O
experience	O
the	O
out-of-memory	O
may	O
or	O
may	O
not	O
be	O
the	O
program	O
that	O
has	O
the	O
memory	B-General_Concept
leak	O
.	O
</s>
<s>
Some	O
multi-tasking	B-Operating_System
operating	B-General_Concept
systems	I-General_Concept
have	O
special	O
mechanisms	O
to	O
deal	O
with	O
an	O
out-of-memory	O
condition	O
,	O
such	O
as	O
killing	O
processes	O
at	O
random	O
(	O
which	O
may	O
affect	O
"	O
innocent	O
"	O
processes	O
)	O
,	O
or	O
killing	O
the	O
largest	O
process	O
in	O
memory	B-General_Concept
(	O
which	O
presumably	O
is	O
the	O
one	O
causing	O
the	O
problem	O
)	O
.	O
</s>
<s>
Some	O
operating	B-General_Concept
systems	I-General_Concept
have	O
a	O
per-process	O
memory	B-General_Concept
limit	O
,	O
to	O
prevent	O
any	O
one	O
program	O
from	O
hogging	O
all	O
of	O
the	O
memory	B-General_Concept
on	O
the	O
system	O
.	O
</s>
<s>
The	O
disadvantage	O
to	O
this	O
arrangement	O
is	O
that	O
the	O
operating	B-General_Concept
system	I-General_Concept
sometimes	O
must	O
be	O
re-configured	O
to	O
allow	O
proper	O
operation	O
of	O
programs	O
that	O
legitimately	O
require	O
large	O
amounts	O
of	O
memory	B-General_Concept
,	O
such	O
as	O
those	O
dealing	O
with	O
graphics	O
,	O
video	O
,	O
or	O
scientific	O
calculations	O
.	O
</s>
<s>
If	O
the	O
memory	B-General_Concept
leak	O
is	O
in	O
the	O
kernel	B-Operating_System
,	O
the	O
operating	B-General_Concept
system	I-General_Concept
itself	O
will	O
likely	O
fail	O
.	O
</s>
<s>
Computers	O
without	O
sophisticated	O
memory	B-General_Concept
management	I-General_Concept
,	O
such	O
as	O
embedded	B-Architecture
systems	I-Architecture
,	O
may	O
also	O
completely	O
fail	O
from	O
a	O
persistent	O
memory	B-General_Concept
leak	O
.	O
</s>
<s>
Publicly	O
accessible	O
systems	O
such	O
as	O
web	B-Application
servers	I-Application
or	O
routers	B-Protocol
are	O
prone	O
to	O
denial-of-service	O
attacks	O
if	O
an	O
attacker	O
discovers	O
a	O
sequence	O
of	O
operations	O
which	O
can	O
trigger	O
a	O
leak	O
.	O
</s>
<s>
A	O
"	O
sawtooth	O
"	O
pattern	O
of	O
memory	B-General_Concept
utilization	O
may	O
be	O
an	O
indicator	O
of	O
a	O
memory	B-General_Concept
leak	O
within	O
an	O
application	O
,	O
particularly	O
if	O
the	O
vertical	O
drops	O
coincide	O
with	O
reboots	O
or	O
restarts	O
of	O
that	O
application	O
.	O
</s>
<s>
Care	O
should	O
be	O
taken	O
though	O
because	O
garbage	B-General_Concept
collection	I-General_Concept
points	O
could	O
also	O
cause	O
such	O
a	O
pattern	O
and	O
would	O
show	O
a	O
healthy	O
usage	O
of	O
the	O
heap	O
.	O
</s>
<s>
Note	O
that	O
constantly	O
increasing	O
memory	B-General_Concept
usage	I-General_Concept
is	O
not	O
necessarily	O
evidence	O
of	O
a	O
memory	B-General_Concept
leak	O
.	O
</s>
<s>
Some	O
applications	O
will	O
store	O
ever	O
increasing	O
amounts	O
of	O
information	O
in	O
memory	B-General_Concept
(	O
e.g.	O
</s>
<s>
as	O
a	O
cache	B-General_Concept
)	O
.	O
</s>
<s>
If	O
the	O
cache	B-General_Concept
can	O
grow	O
so	O
large	O
as	O
to	O
cause	O
problems	O
,	O
this	O
may	O
be	O
a	O
programming	O
or	O
design	O
error	O
,	O
but	O
is	O
not	O
a	O
memory	B-General_Concept
leak	O
as	O
the	O
information	O
remains	O
nominally	O
in	O
use	O
.	O
</s>
<s>
In	O
other	O
cases	O
,	O
programs	O
may	O
require	O
an	O
unreasonably	O
large	O
amount	O
of	O
memory	B-General_Concept
because	O
the	O
programmer	O
has	O
assumed	O
memory	B-General_Concept
is	O
always	O
sufficient	O
for	O
a	O
particular	O
task	O
;	O
for	O
example	O
,	O
a	O
graphics	O
file	O
processor	O
might	O
start	O
by	O
reading	O
the	O
entire	O
contents	O
of	O
an	O
image	O
file	O
and	O
storing	O
it	O
all	O
into	O
memory	B-General_Concept
,	O
something	O
that	O
is	O
not	O
viable	O
where	O
a	O
very	O
large	O
image	O
exceeds	O
available	O
memory	B-General_Concept
.	O
</s>
<s>
To	O
put	O
it	O
another	O
way	O
,	O
a	O
memory	B-General_Concept
leak	O
arises	O
from	O
a	O
particular	O
kind	O
of	O
programming	B-Error_Name
error	I-Error_Name
,	O
and	O
without	O
access	O
to	O
the	O
program	O
code	O
,	O
someone	O
seeing	O
symptoms	O
can	O
only	O
guess	O
that	O
there	O
might	O
be	O
a	O
memory	B-General_Concept
leak	O
.	O
</s>
<s>
It	O
would	O
be	O
better	O
to	O
use	O
terms	O
such	O
as	O
"	O
constantly	O
increasing	O
memory	B-General_Concept
use	O
"	O
where	O
no	O
such	O
inside	O
knowledge	O
exists	O
.	O
</s>
<s>
The	O
following	O
C++	B-Language
program	I-Language
deliberately	O
leaks	O
memory	B-General_Concept
by	O
losing	O
the	O
pointer	O
to	O
the	O
allocated	O
memory	B-General_Concept
.	O
</s>
