Slide 10
Slide 10 text
Garbage
Collec2on
-‐
Two
Main
Types
• Coun2ng
–
keep
track
of
how
many
other
objects
reference
an
object,
if
the
number
of
references
reaches
0
then
collect
the
object
• Tracing
–
when
you
run
out
of
memory,
find
all
the
reachable
objects,
collect
all
the
other
(unreachable)
objects