How to uninstall classLoader and hot deploy JVM
This article shows you how to uninstall classLoader and JVM hot deployment, the content is concise and easy to understand, can definitely make your eyes bright, through the detailed introduction of this article, I hope you can get something.
Unloading Mechanism of classLoader
Unload methods for class and classloader are not provided in jvm. What is the mechanism for hot deployment and osgi? The main idea is to change the classLoader to reload. The previous classloader and loaded class classes will be recycled in the case of gc in the perm area without instance references.
What is the process of recycling unreferenced class when gc in the perm area?
After the ◆ perm area reaches the recycling condition, the class is referenced and the class that is not referenced is recycled.
When will the ◆ classLoader instance be recycled? (it is very likely to enter old gen). In general, does perm zone recycling trigger full gc to clear that no instance references this classloader?
Memory problem
◆ if there is an instance class that has a reference to classloader, the perm area class cannot be uninstalled, causing the perm area memory to increase all the time, which leads to perm space error.
Public static Map pool = new HashMap (); public static void main (String [] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException {for (int itemositani)