开发者

Java app slower due to web start

开发者 https://www.devze.com 2023-01-26 00:24 出处:网络
I\'m trying to deploy my Java application using Java Web Start, but I\'ve come across 开发者_StackOverflowa problem. When running the application through my IDE (Netbeans) it\'s lightning fast; everyt

I'm trying to deploy my Java application using Java Web Start, but I've come across 开发者_StackOverflowa problem. When running the application through my IDE (Netbeans) it's lightning fast; everything happens within seconds. However if it's launched with Web Start it's excruciatingly slow.

Any ideas why?

I'm self-signing everything and using full permissions in the JNLP.


Java Web Start applications will always launch more slowly than launching directly via the java executable. This is because Java Web Start is doing so much more than a standard java launch:

  1. JWS accesses the network to download the JNLP (and possibly JARs, and other resources)
  2. JWS is checking its local cache of JARs to see if it can skip downloading the JARs
  3. JWS is potentially downloading the jars via HTTP, if the cache is empty or out of date
  4. JWS is checking the validity of the cryptographically strong signatures of every single jar

I think most of this is an unavoidable cost for the added power of being able to launch your application via a web browser and update your application virtually "for free."


Another possibility: Is your application running with a different VM when you launch via webstart vs. when you launch with NetBeans? You can try printing:

System.getProperty("java.home")

to find out what VM is running the currently executing process.

If it's the same VM, you might also try diffing the Java system properties between the two scenarios. Try printing out all System properties:

System.getProperties().store(System.out, "");

Wireshark can be used to help diagnose Java Web Start network issues.


Sometimes the Java Console and Java Web Start Logging can be useful in diagnosing certain JWS problems. You can enable these features through the Java Control Panel:

Java app slower due to web start


You can enable full logging in the Java Console and see all the things that Java Web Start is printing of debug information. You can then see where the pauses happen, which may give you an indication of the problem.

My initial guess would be that you have DNS issues, especially if the pauses are very close to a multiplum of 30 seconds.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号