Can static variables be garbage collected in Java?
Amit Y Desai
posted 7 years ago
if a static variable is set to null,then memory it references get garbage collected.
Useful note : Variables with the longest lifetime are static variables, you should be careful to assign null to any variable that are no longer used, especially if they reference large data structures.