The Garbage Collector
The Instruction set contains commands only for the allocation of memory. A mechanism is needed to recycle the non-used, and de-fragment the used memory.
A Garbage Collector is always running on a low priority thread and is looking for un-referenced objects that it can free. When it finds them it calls their finalize() method and then destroys them.
Many Implementations of Collectors:
- Conservative, Reference Counting, Tracing.
An object can be reachable, resurrectable or unreachable.