Sign in to follow this  
The Rug

[java] "java -server" performance boost

Recommended Posts

Simple question? Maybe... I've just found that using the "-server" command line parameter when invoking Java almost doubles my application's performance in some situations. The snag is that the JRE for Windows doesn't actually include the Server JVM, only the client. The Server JVM comes with the JDK, and is simply an alternative jvm.dll in the folder JDKxxx/jre/bin/server. Unfortunately, I can't realisticly expect the end-users of my app to download and install the JDK then copy the relevant file into their JRE. I want my app to perform as well as possible, but I'm pretty sure I can't distribute the alternative jvm.dll with my app without pissing Sun off. Distributing the entire JDK is out of the question. Can anyone offer me any advice here? Does anyone know why the Server JVM isn't distributed with the JRE, when in certain situations it gives a clear performance advantage? Is the Server JVM likely to be distributed with the JRE in future (as far as I'm aware this is already the case with the Solaris version)? Is there anything I can do (tweaking command line paramteres, etc.) to get myself a similar performance increase? Cheers to anyone who can help.

Share this post


Link to post
Share on other sites
I here is a link to an article on it(after the Java vs. C++ benchmark at the end):
http://java.sys-con.com/read/45250.htm

I have the server jvm is in the 1.5j2se jre

I switched the line order -server and -client in the textfile like the article says and see a big speed increase in everything!

Why they don't just use that jvm, I don't know? I also noticed that that JVM is larger in size then the client..hmm..

Share this post


Link to post
Share on other sites
Because it takes far longer to get going, that's why... no good for little client apps.

Next release of Java will apparently combine the two VMs into a single two-stage compiler giving us the best of both.

Cas :)

Share this post


Link to post
Share on other sites
Thanks guys.

Quote:
I have the server jvm is in the 1.5j2se jre

Are you sure? I downloaded the JRE, and it isn't there... as I said, I had to copy the .dll from my JDK install into the JRE.

Princec: That's good news! Do you have a source for this? (Just to be 100%)

Share this post


Link to post
Share on other sites
The server VM is not included in j2se 5.0 on Windows - you are free to distribute it from the JDK however.

Haven't got a 100% source on 2-stage compilation - just piecing together info from Ken Russell and Azeem Jiva on the javagaming.org forums.

Cas :)

Share this post


Link to post
Share on other sites
Quote:

The server VM is not included in j2se 5.0 on Windows - you are free to distribute it from the JDK however.

As in, I could take it from the JDK and bundle it with the JRE and my app (using a custom installer)?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this