File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes JVM Server Mode vs Client Mode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "JVM Server Mode vs Client Mode" Watch "JVM Server Mode vs Client Mode" New topic
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: 18505
    
  40

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: 18505
    
  40

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JVM Server Mode vs Client Mode
 
Similar Threads
View the objects which are getting stored in permgen and total non heap space
Server startup
JVM in Server or Client mode ?
How to create Server
Questions on HotSpot