Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6763424

JDK 1.6 classloader geometric slowdown of 20-300x fixed in 1.6.0_10-rc2-b32

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 6
    • core-libs
    • x86
    • windows_vista

      FULL PRODUCT VERSION :
      JDK 1.5.0_xx (no problems run in 30 sec)
      JDK 1.6.0_04 (takes 240 min)
      JDK 1.6.0_06 (takes 240 min)
      JDK 1.6.0_07 (takes 240 min)
      JDK 1.6.0_10-rc2-b32 (no problems run in 30 sec)

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP SP3 & Windows Vista Ultimate SP1

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Test is an in memory ant junit test suite that creates SDO DataObjects
      -mx = 512mb
      2 systems
      P4-550 (3.4ghz) 4gb ram
      Quad Core Q6600 (2.4ghz) 3gb ram


      A DESCRIPTION OF THE PROBLEM :
      We have observed a major geometric slowdown in the classloader for JDK 6 detailed in the EclipseLink Eclipse bug below.

      http://bugs.eclipse.org/248019

      The behavior we are seeing is that in a JUnit test suite running on ant after about 5000 classes are loaded we start to see a dramatic slowdown eventually to the point that classloader logs [using ant -verbose] pass by at 1 per second as we reach 40000 classes loaded [viewable using jconsole.exe].

      In JDK 1.5.0 our particular test suite took ~30 sec ro run.
      Under any JDK except (1.6.0_10-rc2-b32) it takes 2 hours to run.

        Fix:
      ----------
      I tried the latest Java 6 JDK 1.6.0_10-rc2-b32 (beta) release and this seems to fix this classloader slowdown issue. The performance is returned to the same performance under JDK 1.5 (around ~30) seconds.

      My question is was there a classloader fix put into JDK 1.6.0_10-rc2-b32 that removed an implementation that seemed to grow exponentially in runtime as the number of classes loaded by the JVM grew?

      I would like to narrow this classloader slowdown in Java 6 to the classloader or understand where else the slowdown may have occurred.


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Load 5000+ classes in a single JUnit test suite running on ant
      observe results by attaching to the optional java.exe in jconsole

      Compile the code using the same JDK that you use to run the bytcode (does not reproduce if the code is compiled in a 1.5 JDK and run on 1.6)

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      JDK 1.5 = 30 sec

      ACTUAL -
      but we are seeing 240 min in JDK 1.6
      (Except in JDK 1.6.0_10-rc2-b32 which loads all the classes in 30 sec in the same time as run in JDK 1.5.0_xx)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      No error messages (no memory messages as memory peaks at 100mb and -mx = 512mb)
      Just a slowdown in performance and 1 JUnit classloader message per second instead of 1000's per second

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      Setup a junit test suite that loads ~40000 classes

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Install JDK 1.6.0_10-rc2-b32 - performance is returned to 30 sec for 40000 classes loaded.

      JDK 1.6.0_04 to JDK 1.6.0_07 have this classLoader geometrically growing slowdown issue

            valeriep Valerie Peng
            ndcosta Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: