GCIntro.pdf

(261 KB) Pobierz
Project Sun SPOT Overview
Introduction to
Gargbage Collection (GC)
Sang Shin
Technology Evangelist
Technology Evangelist
Sun Microsystems, Inc.
Sun Microsystems, Inc.
www.javapassion.com
1
Introduction to
Gargbage Collection (GC)
Sang Shin
623027322.003.png 623027322.004.png
Topics
What is Garbage Collection (GC)?
Why GC?
When does GC occur?
How does GC get performed?
2
623027322.005.png
What is Garbage
Collection (GC)?
What is Garbage
Collection (GC)?
623027322.006.png
What is GC?
The Java virtual machine's heap stores all objects
created by a running Java application.
Objects are created by the program through new
keyword, but never freed explicitly by the program
> No need to call free().
Garbage collection is the process of automatically
freeing objects that are no longer needed
An object is determined to be “no longer needed” when
there is no other object referencing to it
> Each object has a reference counter - when it becomes 0, it
means there is no other object referencing to it
4
623027322.001.png
Why Garbage
Collection (GC)?
Why Garbage
Collection (GC)?
623027322.002.png
Zgłoś jeśli naruszono regulamin