2 Replies Latest reply: Mar 6, 2011 8:25 PM by user3269289 RSS

    Does WL has high-performance ClassLoader? ChangeAwareCL is too slow.

    user3269289
      Hi!

      I recently profiled application deployed to WebLogic10.3.3 during load-testing. What I saw is that majority of our threads are in 'blocked' state. They are blocked on the call to ChangeAwareClassLoader.loadClass(String) (which looks to be synchronized). So effectively our app is not so "multithreaded" as it can be :)

      Tried to switch WL to production mode, disabled all options with "reloading" in their name, but app is still launched within ChangeAwareCL. Obviously, this classloader is very useful in development mode, but in production changes in application classes is not something to be expected. Are there any way to load deployed application using GenericClassLoader or any other ClassLoader with loadClass(String) suitable for multi-threaded environments?

      Regards,
      Vadim.
        • 1. Re: Does WL has high-performance ClassLoader? ChangeAwareCL is too slow.
          PHCharbonneau
          Hi Vadim,

          Can you please share the Thread Dump data so we can look at the source of contention / blocked threads?

          Most of the class loading operations are normally happening at deployment time and during initial requests to you application. Dynamic class loading can also be observed from framework using Reflection API etc. (see example below).

          Too much class loading under heavy load / concurrent Threads is to be avoided as it can increase CPU/IO utilization since class loader must first to read/get class from jar files/classpath.

          For your current situation, it will really help to analyse the Thread Dump data to understand the source of these class loading calls (ChangeAwareClassLoader.loadClass(String)). Find below an example of slow Thread involved in class loading operation triggered from Apache Beehive framework. This is a problem that we faced 2 years ago with a Weblogic Integration 9.2 environment.

          "[ACTIVE] ExecuteThread: '3' for queue: 'weblogic.kernel.Default (self-tuning)'" RUNNABLE native
               java.util.zip.ZipFile.getEntry(Native Method)
               java.util.zip.ZipFile.getEntry(ZipFile.java:289)
               java.util.jar.JarFile.getEntry(JarFile.java:282)
               java.util.jar.JarFile.getJarEntry(JarFile.java:265)
               sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:949)
               sun.misc.URLClassPath$JarLoader.findResource(URLClassPath.java:938)
               sun.misc.URLClassPath.findResource(URLClassPath.java:299)
               java.net.URLClassLoader$3.run(URLClassLoader.java:784)
               java.security.AccessController.doPrivileged(AccessController.java:219)
               java.net.URLClassLoader.findResource(URLClassLoader.java:781)
               java.lang.ClassLoader.getResource(ClassLoader.java:420)
               org.apache.commons.discovery.jdk.JDK12Hooks.getResources(JDK12Hooks.java:149)
               org.apache.commons.discovery.resource.DiscoverResources$1.getNextResources(DiscoverResources.java:153)
               org.apache.commons.discovery.resource.DiscoverResources$1.getNextResource(DiscoverResources.java:129)
               org.apache.commons.discovery.resource.DiscoverResources$1.hasNext(DiscoverResources.java:116)
               org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassNames(DiscoverNamesInFile.java:186)
               org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.getNextClassName(DiscoverNamesInFile.java:170)
               org.apache.commons.discovery.resource.names.DiscoverNamesInFile$1.hasNext(DiscoverNamesInFile.java:157)
               org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.getNextResource(ResourceClassDiscoverImpl.java:159)
               org.apache.commons.discovery.resource.classes.ResourceClassDiscoverImpl$1.hasNext(ResourceClassDiscoverImpl.java:147)
               org.apache.commons.discovery.tools.DiscoverClass.find(DiscoverClass.java:389)
               org.apache.commons.discovery.tools.DiscoverClass.find(DiscoverClass.java:279)
               org.apache.beehive.controls.runtime.bean.ControlBean.lookupControlBeanContextFactory(ControlBean.java:949)
               org.apache.beehive.controls.runtime.bean.ControlBean.<init>(ControlBean.java:101)
          .........................................................................................................................

          Thanks.
          P-H
          http://javaeesupportpatterns.blogspot.com/
          • 2. Re: Does WL has high-performance ClassLoader? ChangeAwareCL is too slow.
            user3269289
            Hello.

            Source of contention is that we create a lot of EntityManagers (spring's implementation) and they make a lot of calls to the ClassLoader.loadClass(String).
            Originally I thought that loadClass should be reasonably fast (caching) operation, but as it turns out - it shouldn't.
            Because this issue is obviously not related by WL classloading, I'm closing this question.
            Thanks for your time.

            Regards.