How can you force garbage collection of an object in Java?
Garbage collection cannot be forced
Call System.gc()
Call System.gc(), passing in a reference to the object to be garbage-collected
Call Runtime.gc()
Set all references to the object to new values (null, for example)