JDK-8155912 : slow Java Webstart Application startup : possible performance problem in TrustDecider implementation
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u77
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2016-04-14
  • Updated: 2017-05-12
  • Resolved: 2017-05-12
Related Reports
Duplicate :  
Description
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.


Comments
Based upon the update from submitter it seems that the performance issue is resolved with 8u91 (Fix from JDK-8144963). The other issue is perhaps need to be submitted as a new report. Will check with Dev. about the probability for "Class does not match trust level of other classes in the same package" errors, which looks similar to JDK-8155076. Moving this report open and keeping this open till further clarification from dev.
03-05-2016