I use java reflection in the code as follows:
Method method = LogFactory.class.getDeclaredMethod("getContextClassLoader"); method.setAccessible(true); ClassLoader classLoader = (ClassLoader)method.invoke(null); LogFactory.release(classLoader);
I use jprofiler to see many classes like this sun.reflect.GeneratedMethodAccessor11
these classes increase per call
sun.reflect.BootstrapConstructorAccessorImpl sun.reflect.NativeConstructorAccessorImpl sun.reflect.DelegatingConstructorAccessorImpl sun.reflect.DelegatingClassLoader
I think thatβs why PermGen space is increasing, how to clear these classes?
source share