[JAVA学习笔记-94]JVM的client与server模式

来源:互联网 发布:域名主机系统 编辑:程序博客网 时间:2024/05/17 00:14
    client模式在 64-bit JDK上已经被忽略了,直接使用Java Hotspot Server VM.
出处:https://docs.oracle.com/javase/7/docs/technotes/tools/windows/java.html

-client
Selects the Java HotSpot Client VM. A 64-bit capable JDK currently ignores this option and instead uses the Java Hotspot Server VM.
For default Java VM selection, see the Server-Class Machine Detection page at
http://docs.oracle.com/javase/7/docs/technotes/guides/vm/server-class.html


-server
Selects the Java HotSpot Server VM. On a 64-bit capable JDK, only the Java Hotspot Server VM is supported so the -server option is implicit.


For default a Java VM selection, see the Server-Class Machine Detection page at
http://docs.oracle.com/javase/7/docs/technotes/guides/vm/server-class.html

两种模式的确有一些差别:
client模式:
优化了内存占用,启动速度,应用执行速度,例如对GUI的响应更迅速。
server模式:
在运行性能、稳定性上做了更多优化,例如可能针对高并发场景,对锁,内存的使用进行了优化。更适用于长时间稳定高强度的应用。

根据官方文档来看,64位平台上两者的差异已经很小,模式使用server模式。
原创粉丝点击