|
Replies:
13
-
Last Post:
Nov 17, 2008 4:13 AM
by: kamaltiwari123
|
Threads:
[
Previous
|
Next
]
|
|
|
|
|
|
Start quicker by tuning JVM and javac
Posted:
Apr 16, 2008 11:54 AM
|
|
|
Hello.
I'm searching the ways to reduce startup time of my small desktop application. I'm searching among Java VM and javac compiler options.
For example, seems that following could help:
1. java -client (Select the Java HotSpot Client VM. In general, the server VM starts up more slowly than the client VM, but over time runs more quickly.)
2. javac -g:none (Do not generate any debugging information)
3. java -Xms, -Xmx (and other performance tuning options).
I look forward to hearing your thoughts.
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Apr 16, 2008 2:38 PM
in response to: maksym_shostak
|
|
|
Compiler options won't help that much I fear.
Best you can do is install JDK6u10-beta (the most recent build) and enable quickstarter, this should help much more than anything else.
The client-jvm should be default anyhow ... oh well wait ...on Linux with 2CPUs and 2GB ram its now the server compiler, because this is considered a server-class machine. Really stupid, my Laptop has already 3GB ram!
lg Clemens
|
|
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Aug 29, 2008 4:31 AM
in response to: maksym_shostak
|
|
|
More stupid engineering -- if it's a server, wouldn't there be a System Administrator that would make sure that the server JVM is the default?
Average machines these days have over 2gig mem and more than 2 processors.
May I suggest that the Java Dev Team is trying to make Java into some sort of Artificial Intelligence entity that tries to anticipate the users needs. It's easier and simpler to let the human figure it out using standard and conventional use patterns.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Aug 31, 2008 3:16 AM
in response to: maksym_shostak
|
|
|
If you only have the JRE installed then the server VM will not be available.
One option that can make a significant difference to the startup time is -Xverify:none
Obviously use this with some degree of caution since it turns off class byte code verification.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Aug 29, 2008 9:54 AM
in response to: maksym_shostak
|
|
|
I'm not sure if it works anymore, but some while ago people were placing class files in a JAR with no compression to speed up class loading. Class loading does slow things down on the start-up. This also hints at application design, where main application window would appear sooner the less classes it needs to load and the lesser number of objects it has to instantiate. Thus, try deferring initialization of non-essential things, but not to the degree where everything loads on demand: that might hurt perception of responsiveness. And now we arrived at the most important thing: perception of performance. Your customer will wait a little and will not be outraged about it if you provide some feedback. Splash screen with progress indicator (while you eagerly load all essential resources and restore application state) is a must.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Aug 29, 2008 5:11 PM
in response to: denka
|
|
|
Exactly. Will someone please explain this to the NetBeans team. The current lazy loading trend does not assist in perceived performance.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Aug 31, 2008 3:22 AM
in response to: maksym_shostak
|
|
|
What version of the JVM are you using?
I've had favourable experiences with the JVM Quick Starter enhancement in the up coming 6.0u10 release (now in the RC stages) - this improves cold start times on Windows.
https://jdk6.dev.java.net/
Cheers,
Chris.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Aug 31, 2008 4:42 AM
in response to: maksym_shostak
|
|
|
You could create your jar with the option '-i'.
-i = generate index information for the specified jar files
Classloading from that jar will be faster.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Aug 31, 2008 2:49 PM
in response to: maksym_shostak
|
|
|
General question - I'm seeing quite a few posts around discussing Java start up times.
Does anyone know if there is an official benchmark that can be used to measure start up times for desktop applications, web start apps and applets?
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Sep 1, 2008 4:00 AM
in response to: lowecg
|
|
|
We have some application startup time benchmarks, but they are not official, we use them internally for (regression) testing of our Startup Optimizer. I could post a few bits of methodology (disk cache cleanup) here if you are interested.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Sep 1, 2008 4:07 AM
in response to: dleskov
|
|
|
Yes please, anything you could give me would be greatly appreciated.
Cheers,
Chris.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Sep 30, 2008 5:24 AM
in response to: lowecg
|
|
|
We have a special mode in our JVM in which it measures the length of the different phases of startup, calculates working set size, counts the number of page faults, and so on. I think Sun may have done something similar, so maybe you can get that by rebuilding the OpenJDK?
For measuring the overall startup times on HotSpot, we patch the test programs so that they exit as soon at the main() method receives control, or when the main window is displayed, etc.
You also have to remove the application and the JRE from disk cache if you want to measure cold startup. There are three options on Windows:
1. Remove everything from %windir%\Prefetch and reboot.
2. Run a memory-hungry task (our night build works perfectly )
3. Write a small memory eater. Aggressive ones can make Windows unstable though.
Make sure no Java app using the same JRE is launched on system startup or login.
|
|
|
|
|
|
|
|
Re: Start quicker by tuning JVM and javac
Posted:
Nov 17, 2008 4:13 AM
in response to: dleskov
|
|
|
hi , i am kamal.l am little bit confused that , what is the need to remove files from prefetch and boot directory.
plz try to explain it.
looking forward to hearing you.
thanks regards Kamal
|
|
|
|
|