Once a class object is loaded into memory, when will it be released?

according to the saying on the Internet:
1. All objects of type class are destroyed. two There is no place to refer to class"s reflection. 3. The classloader that loaded the class was destroyed. Only when these three conditions are met will the class object be destroyed.

AppClassloader,ExtensionClassloader,bootstrapClassloader should be created with the creation of jvm and die with the closure of jvm. So the class object will never be released?

Apr.25,2022

whoever loads and releases. This is not to say that bootstrap will not destroy classes loaded by other loaders


http://www.importnew.com/2246... Porter


the class object will be released when the class loader that loads this class is released.

Menu