JDK-8075574 : launching app via webstart extremely slow
  • Type: Bug
  • Component: deploy
  • Sub-Component: webstart
  • Affected Version: 8u40
  • Priority: P4
  • Status: Resolved
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86_64
  • Submitted: 2015-03-13
  • Updated: 2015-09-14
  • Resolved: 2015-05-06
Related Reports
Duplicate :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.8.0_40"
Java(TM) SE Runtime Environment (build 1.8.0_40-b25)
Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)


A DESCRIPTION OF THE PROBLEM :
The java webstart application launch process is two-phased:

The first phase runs javaws, which downloads the application, updates verifies, etc.

The first stage then launches another JVM to run the application - the second stage.

The problem is that the second stage also seems to download, or at least update the cache, for jars that the first stage has already processed.

If you look at the log in the error message section, it does this for every jar, on every launch, even subsequent ones.

I believe the problem is in the CacheEntry.readIndexFile(), in that it is ALWAYS calling saveUpgrade() - something is wrong with the "check" code.

All of our jars are 1.5+ signed, and include timestamps (although the same problem occurs without timestamps).

In an application with lots of jars, this re-writing of the jars is causing EXTREMELY SLOW start-up.

ADDITIONAL REGRESSION INFORMATION: 
It also does not work with jre1.7.0_67.

It works - start-up is instant - if I use jre1.7.0_21 and I remove the java cache before the first start. It is fine on subsequent starts.



STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
enable logging and tracing and start any java webstart app. You will see that every dependent jar is ALWAYS "upgraded", on every launch.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
It may need to upgrade your cache on the first launch, but certainly not if it's empty, or just downloaded.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
network: Cache entry found [url: http://devrt:8088/optionscity/optionscity/metro/filedrop.jar, version: null] prevalidated=false/0
cache: Adding MemoryCache entry: http://devrt:8088/optionscity/optionscity/metro/filedrop.jar
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@2628e91c: 1
cache: registerReference: com.sun.deploy.cache.MemoryCache$CachedResourceReference@2628e91c: 2
security: blacklist: hasBeenModifiedSince 0 (we have 1426275512000)
cache: Trying to update in place /home/rengels/.java/deployment/cache/6.0/45/14c2752d-33924178.idx
cache: Upgrade writing to disk for /home/rengels/.java/deployment/cache/6.0/45/14c2752d-33924178
security: blacklist: check contains UT6O+cMmwfsRuDdAnrilgQvB904IFUjhFDJD44Trlmc=, state now IN_MEMORY
security: blacklist: not  found in cache
security: Trusted libraries list file not found
cache: Create from verifier: JarSigningData{hasOnlySignedEntries=true, hasSingleCodeSource=true, hasMissingSignedEntries=false}
cache: Upgrade of entry done
cache: readIndexFile returning success

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
use jre1.7.0_21


Comments
this is likely, from description, a duplicate of https://bugs.openjdk.java.net/browse/JDK-8079223 If we don't have specific testcase, we need to ask customer to test with build of 8u60 when build with that fix is promoted. Testing with https://www.theice.com/launch shows the app is still somewhat slow on second and subsequent launches, but I will have to compare with 8u45 to see if there is significant improvement. (It is no longer calling saveUpgrade) - also loading cache viewer is no longer slow after fix.
05-05-2015

Plan: Need to identify or create a web start app as mentioned in the report.
17-03-2015