[java] "java -server" performance boost

Started by
5 comments, last by princec 18 years, 7 months ago
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.
the rug - funpowered.com
Advertisement
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..
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 :)
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%)
the rug - funpowered.com
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 :)
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)?
the rug - funpowered.com
Yes.

Cas :)

This topic is closed to new replies.

Advertisement