Sun JVM comes in two types: -client
and -server
, where server VM is optimized for long-running processes, and is recommended for server applications.
When I run java
with a parameter, it displays the usage option, which includes the following text:
is the default VM server, Because you are running on a server-class machine
After seeing this, I did not have trouble connecting the process to -server
in the startup command.
However, recently on the JVM crash log, I saw the following line near the end of the file:
vm_info: Linux-X86 JRE (1.6.0_14-B-08) ) For Java hotspot (TM) client VM (14.0-B16), Created on 21 May 2009 02:01:47 with "java_re" with gcc 3.2.1-7a (j2se released)
I think the Java client is using VM, despite this what the help message says in the message. I'll add the -server
option to my startup command, but now I doubt if my question is: Is there any way to ensure that the VM that I'm running is actually server VM Is, without compelling a JVM crash?
The OS is Ubuntu 8.04, but I am using JDK 1.6.0_14 which I downloaded from Sun's website.
you can
System.out.println (System .getProperty ("java.vm.name"));
What returns on my machine:
Java HotSpot (TM) client VM
or < / P>
Java Hotspot (TM) 64-bit server VM
Of course, you should not do anything important on this value, because it may be in the future Will change, and will be completely different on another JVM.
No comments:
Post a Comment