This question is for the java language in particular. I understand that there is a static protion of memory set aside for all static code.
My question is how is this
If the static field is changed to reference a different object, the original object pointed to by the static field is eligible for GC just like any other object.
It could also be free'ed (even if not nulled) if the class itself is unloaded and the entire object graph is cut from the heap. Of course, when a class can be unloaded is a good topic for a host of other questions... :)