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

java.net.URLClassLoader.findClass uses exceptions in control flow

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Subcomponent:
    • Resolved In Build:
      b31

      Backports

        Description

        If one runs a classloader benchmark:
          http://cr.openjdk.java.net/~shade/8053904/benchmarks.jar

        ...with Nashorn-generated class files:
         http://cr.openjdk.java.net/~shade/8053904/classes.jar

        ...and jdk9 executed as:
         $ java -jar benchmarks.jar -wi 0 -i 30 -r 10s -p file=classes.jar

        ...one can produce this profile:
         http://cr.openjdk.java.net/~shade/8053904/class-install-calltree-java-2.txt

        Looking closely at this profile, one can note a low-hanging fruit: exceptions are frequent. The call tree shows where the exceptions are instantiated. Another view in the profiler shows that a significant amount of time is spend in constructing the stack traces:
         6.670 java.lang.Throwable.fillInStackTrace(int)

        That's 6.6 seconds of total 313 secs of run (around ~2%).
        I think we need to stop doing exceptions there, or at least throw the stackless exceptions.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                redestad Claes Redestad
                Reporter:
                shade Aleksey Shipilev
                Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: