Previous | Next | Trail Map | Reference Objects | Contents

Understanding Garbage Collection

The garbage collector's job is to identify objects that are no longer in use and reclaim the memory they occupy. What does it mean for an object to be in use?


Definition: An object is in use if it can be accessed or reached by the program in its current state.

This lesson explains how garbage collection works when no reference objects are involved, and how things change when neference objects are added to the heap.


Previous | Next | Trail Map | Reference Objects | Contents