My J2EE application is performing slow. We took the Thead Dumps during that situation and found that following thread was Runnable in multiple dumps and has taken locks on some monitors which cause other threads (directly or indirectly) waiting for the locks.
at java.lang.ClassLoader.findBootstrapClass(Native Method)
at java.lang.ClassLoader.findBootstrapClass0(ClassLoader.java:891)
at java.lang.ClassLoader.loadClass(ClassLoader.java:301)
- locked [0x9747c360] (a sun.misc.Launcher$ExtClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
- locked [0x9747c318] (a sun.misc.Launcher$AppClassLoader)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)
- locked [0x9747c318] (a sun.misc.Launcher$AppClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
.....
Can you please suggest which this thread is not moving and letting other threads work?
Why are your app loading so many classes (the locks are in the loadClass)? It is expected that your app load unloaded classes just during initialization and warm up.
So, I suspect that one of the following things are happening:
Needless to say, any of these things are very expensive and should be avoided the maximum possible.