命令行下输入:java -version
说明JVM是server模式,使用server模式的运行时编译器;也就是说还存在client模式与之对应,使用client模式的运行时编译器。client模式适合类似gui应用程序,server模式适合于后台型服务之类的程序。
配置在jvm.cfg文件里,64bit Mac下切换无用:
Windows, 路径:C:\Program Files\Java\jre1.5.0\lib\i386
Mac,路径:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib
我的Mac上默认是server模式,无法修改,参考下面的引用问题2。64位版本里只有server模式。
具体可以参考[url=http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#compiler_types]FAQ About the Java HotSpot VM[/url]
摘录比较重要的两点:
[b]JIT Compiler[/b]
[b]What's the difference between the -client and -server systems?[/b]
These two systems are different binaries. They are essentially two different compilers (JITs)interfacing to the same runtime system. The client system is optimal for applications which need fast startup times or small footprints, the server system is optimal for applications where the overall performance is most important. In general the client system is better suited for interactive applications such as GUIs. Some of the other differences include the compilation policy,heap defaults, and inlining policy.
[b]Where do I get the server and client systems?[/b]
Client and server systems are both downloaded with the 32-bit Solaris and Linux downloads. For 32-bit Windows, if you download the JRE, you get only the client, you'll need to download the SDK to get both systems.
For 64-bit, only the server system is included. On Solaris, the 64-bit JRE is an overlay on top of the 32-bit distribution. However, on Linux and Windows, it's a completely separate distribution.
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
说明JVM是server模式,使用server模式的运行时编译器;也就是说还存在client模式与之对应,使用client模式的运行时编译器。client模式适合类似gui应用程序,server模式适合于后台型服务之类的程序。
配置在jvm.cfg文件里,64bit Mac下切换无用:
Windows, 路径:C:\Program Files\Java\jre1.5.0\lib\i386
Mac,路径:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/jre/lib
#
# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
# ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
# List of JVMs that can be used as an option to java, javac, etc.
# Order is important -- first in this list is the default JVM.
# NOTE that this both this file and its format are UNSUPPORTED and
# WILL GO AWAY in a future release.
#
# You may also select a JVM in an arbitrary location with the
# "-XXaltjvm=<jvm_dir>" option, but that too is unsupported
# and may not be available in a future release.
#
-server KNOWN
-client IGNORE
-hotspot ERROR
-classic WARN
-native ERROR
-green ERROR
我的Mac上默认是server模式,无法修改,参考下面的引用问题2。64位版本里只有server模式。
具体可以参考[url=http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#compiler_types]FAQ About the Java HotSpot VM[/url]
摘录比较重要的两点:
[b]JIT Compiler[/b]
[b]What's the difference between the -client and -server systems?[/b]
These two systems are different binaries. They are essentially two different compilers (JITs)interfacing to the same runtime system. The client system is optimal for applications which need fast startup times or small footprints, the server system is optimal for applications where the overall performance is most important. In general the client system is better suited for interactive applications such as GUIs. Some of the other differences include the compilation policy,heap defaults, and inlining policy.
[b]Where do I get the server and client systems?[/b]
Client and server systems are both downloaded with the 32-bit Solaris and Linux downloads. For 32-bit Windows, if you download the JRE, you get only the client, you'll need to download the SDK to get both systems.
For 64-bit, only the server system is included. On Solaris, the 64-bit JRE is an overlay on top of the 32-bit distribution. However, on Linux and Windows, it's a completely separate distribution.