| Author |
JVM Server Mode vs Client Mode
|
Yohan Liyanage
Ranch Hand
Joined: Aug 17, 2007
Posts: 132
|
|
What are the differences between server mode and client mode of the JVM (apart from load time)? As I have heard, Server mode is optimized for better performance, but lately I found out that server mode is slower than client mode for some types of calculations (when running SciMark). For what type of scenarios is it advisable to use the Server VM? Thanks in advance.
|
Yohan Liyanage
http://blog.yohanliyanage.com
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 14606
|
|
The difference is the way that it uses the Just-in-Time compilers. The client mode uses a JIT compiler (originally from Apple), which basically compiles the java bytecodes into native machine code as soon as it is loaded. The server mode uses a JIT compile from Sun, which uses the Java interpreter on the java bytecodes, for a while. Once enough data has been collected about the java class, it is then JIT compiled to native machine code, using the profiling data that it has collected to optimize the compilation. Henry
|
Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
|
 |
Henry Wong
author
Sheriff
Joined: Sep 28, 2004
Posts: 14606
|
|
In terms of usage, people generally recommend using the client option for short lived applications, and the server option for longer lived application, as there is less of a need to spend time profiling an application that doesn't run for very long. In terms of practical usage, people generally switch between these two modes when they encounter a core dump. Although admittingly, I haven't seen this practice is quite a while. Henry
|
 |
 |
|
|
subject: JVM Server Mode vs Client Mode
|
|
|