Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Class unloading
The resulting output is:
How to see the original class loader and loaded class has not been unloaded?
After the operation, the result did not change
Expository not unloaded
so, explicitly calling gc
The output is:
class is unloaded
if the three reference not set to null?
Operational results are:
not unloaded
because when you call gc when the reference is still pointing to the original object
after the call, only to point to the new object, the gc does not make sense
, then, the gc another location
In this case, the class is unloaded
Use the tool to see jvisualvm