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

slow Java Webstart Application startup : possible performance problem in TrustDecider implementation

XMLWordPrintable

    • x86_64
    • windows_7

      FULL PRODUCT VERSION :
      java version "1.8.0_77"
      Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
      Java HotSpot(TM) Client VM (build 25.77-b03, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      We observe a slow startup of our webstart application. It's a big rich client app with approx. 200 JARS.
      I can provide you a link to the application via private E-Mail.
      We did a performance profiling of the startup process.
      I can send you the HTML export of the JProfiler CPU profiling session via private E-Mail.
      We observed two performance hotspots:
      1.)
      During the verification process of the Jars
      com.sun.deploy.security.EnhancedJarVerifier#validate
      took most of the time when updating the SHA2 message digests.

      There is probably not much you can do about it.

      2.)
      When starting the application, when reading and initializing the Spring app contexts we noticed the following:
      When a resource is loaded via
      com.sun.deploy.security.DeployURLClassLoader.getResourceAsStream
      it takes the following way:
        com.sun.deploy.security.DeployURLClassLoader.getResourcePermission
          com.sun.deploy.security.TrustDecider.isAllPermissionGranted
            com.sun.deploy.security.TrustDecider.isAllPermissionGrantedInt
              com.sun.deploy.security.TrustDecider.validateChain
                com.sun.deploy.security.TrustDecider.getValidationState
                  com.sun.deploy.security.TrustDecider.ensureAllJarEntriesSigned
      It seems as if a resource is loaded, then every other entry in that JAR is checked if it is property signed.
      TrustDecider.ensureAllJarEntriesSigned is called a few hundred times during startup, which is why it takes so long according to the profiler.
      Loading the spring contexts with 8u77 takes about 50 to 55 seconds, whereas it took with 8u31 only 10 to 12 seconds.
      I do not know your deployment code good enough. I just did a profiling session. Again, I can send it to you via private E-Mail.
      Please hava a look, if this cited code is correct.
      We would also appreciate any concrete tipps or workarounds, how to speed up the app startup.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Again, I can provide the link to our production app via private E-Mail.
      I can also give you the profiler output.
      I don't know how to attach files to this issue, so please contact me via E-Mail.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Application startup takes only a few seconds.
      ACTUAL -
      Application startup takes more than a minute in total.

      REPRODUCIBILITY :
      This bug can be reproduced always.

            mcherkas Mikhail Cherkasov (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: