Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

Flavors of JVM

Hi,

I read there are two flavors of JVM one is client mode and other is server mode.

I would like to know advantages, disadvantage, practical uses of each of them.

please advise
Any links resources ideas highly appreciated. Thanks in advance
Avatar of mccarl
mccarl
Flag of Australia image

one is client mode and other is server mode
Essentially, the difference between the two is in how your code gets optimized. Optimization can occur in different ways, in order to maximise different things.

client mode assumes that the application is something that an actual user is running and interacting with as so it will optimize for the fastest possible response time, ie. get something in front of the users face as quick as possible, this might be at the expense of a slower total time to process (or whatever the app is doing). This is useful as generally a human will perceive this faster response time as better overall performance, even if it does take a little longer.

server mode assumes that the application is something that might be sitting in the background, maybe doing something like a batch job, etc. For this, response time means little and so the code will be optimized for the best overall total time to process. For example, it may take a little bit longer to start the application, so that it can get everything set up so that the actually batch run completes in the fastest total time.


http://www.oracle.com/technetwork/java/hotspotfaq-138619.html#compiler_types


One thing that I would add though, in most real world applications, I highly doubt that you would see much difference at all between the two.
Avatar of gudii9

ASKER

how do i know which mode my jvm is running. How  to switch from one mode to other mode on my laptop jvm. please advise
ASKER CERTIFIED SOLUTION
Avatar of mccarl
mccarl
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

If you are on 32-bit windows and have only installed the JRE (not the JDK) then you only have the "client" mode available to you.

how about 64 bit windows like my laptop. There also if only JRE isntalled mode is only 'client'
Please advise

I ran
java -version

i see server mode like below
Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

what is build and what is mixed mode as it showed.