You can't. The garbage collector takes care of recovering dead objects.


If there is a reference to the object in some variable or list outside of the method, the object will be retained.

...