- Make sure you have the geometrie resourceIf necessary, see the Resources import webpage.
- Open a new plain code frame and enter the following java code:
- An unreferenced object is a class instance which is no more referenced by a variable or a class attribute. This object becomes unusable.
Select the Unreferenced objects item with options menu. What do you notice? - Complete the following statements and compare memory diagrams with and without the Unreferenced objects option selected.
How many objects have been created? How many are unreferenced?
The Garbage collector is a mechanism of memory management where the system (the JVM in this case) is responsible for automatically reclaiming memory that is no longer in use; artEoz displays the unreferenced objects but it is not possible to highlight the work of garbage collection. Too bad.