• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client and Sever JVM

 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have installed Jdk 6 in my machine. It should be the client VM only, but is there a command to check that?

Secondly, I am really confused as to when the server VM is used. Could anyone please suggest? For example, when we install an app server like Tomcat or WAS, do these internally use server VM? If not, then where else is it being used?

Thanks
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try typing the command: java -version

It will print something like this:

java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11)
Java HotSpot(TM) Client VM (build 20.4-b02, mixed mode, sharing)


The difference between the client and server VM is in how certain VM parameters are tuned. The client VM is tuned so that programs start up quicker (because that's what users of desktop applications and applets in the browser expect). The server VM might start up a little slower, but performs more optimizations on the program early on, so that the program might run a little bit faster. It's tuned for long-running processes, typical for what happens on a server.

As far as I know there are a number of things that determine whether the client or server VM is used by default, such as how many processors and memory the computer has etc. These criteria are also different for different operating systems, and the 64-bit version of the JVM for Windows always defaults to the server VM. *edit*: This page explains the criteria: Server-Class Machine Detection.

Normally you don't need to worry about whether the client or server VM are being used; functionally they work the same.
 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks that was really helpful..Looks like the 32-bit windows does not even have a Server VM available.

But I still have one doubt. How do we use the server VM in production. Whenever we do server side J2EE programming, does the app server automatically refer to the server VM? Does it install by itself whenever we install the app server or does, the app server ask for the installation location of server VM when it is being installed?
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15441
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dorothy Taylor wrote:Whenever we do server side J2EE programming, does the app server automatically refer to the server VM?

If you don't specify -client or -server on the command line when starting the program, it chooses automatically based on the criteria on the page I linked to above.

Dorothy Taylor wrote:Does it install by itself whenever we install the app server or does, the app server ask for the installation location of server VM when it is being installed?

There's nothing that needs to be installed separately. When you install the JVM or JDK and there's both a client and server version of the JVM available for your system, then those will both be installed at the same time. There's no separate executable for both JVM versions; you both start them with the java command, and it either uses the type that you specify on the command line with the -client or -server options or it chooses one automatically.
 
Joanne Neal
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dorothy Taylor wrote:Looks like the 32-bit windows does not even have a Server VM available.

What makes you think that ? The table only shows that there is no client VM for 64 bit machines.

Jesper de Jong wrote:There's nothing that needs to be installed separately.

I don't think that's true of 32 bit Windows machines that have only installed the JRE (no JDK). The JRE only includes the client VM. If you want the server VM as well, you need to copy the server directory from a JDK's jre\bin directory to your JRE's bin directory.
 
Dorothy Taylor
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ya, that's right. 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.

Thanks all!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic