-2

This article describes -server and -client vaguely. Alot of articles cover it generally but I'm curious what is really being done at the JVM code level.

Calicoder
  • 1,322
  • 1
  • 19
  • 37
  • The best source at "JVM code level" of detail would probably be the JVM source code itself. It's open source, you know. – meriton Jun 03 '19 at 14:58

1 Answers1

2

The -client and -server options have nothing to do with server-side compilation. What they actually do (did) is to select between different configurations of the JVM that are (were) tuned different use-cases:

  • A -client JVM is tuned for faster startup.

  • A -server JVM is tuned for long running applications where startup time is less significant than efficiency.

Note that the -client and -server options are being phased out, and now have little or no effect in most JVM configurations. The last version of Java where the -client and -server options are documented is Java 8. In later versions, this functionality is superseded by tiered compilation and its associated options.


I'm curious what is really being done at the JVM code level.

You can satisfy your curiosity by reading the source code. (Note that it can change from one version of Java to the next.)

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Should be mentioned that these options have been superseded by tiered compilation for some time now and have no effect in most setups. E.g. the 64 bit JDKs from Oracle were never delivered with a client JVM. – Holger Jun 03 '19 at 16:34
  • @StephenC this is very outdated info, those options are _ignored_ since java-8; whatever the manual says - it is wrong. Holger correctly says that Tiered compilation is enabled a long time ago – Eugene Jun 03 '19 at 18:07
  • @StephenC that is exactly what I said and it would not be the [first time](https://stackoverflow.com/questions/49172698/default-hashcode-implementation-for-java-objects) - read through the comments where Stuart Marks is present – Eugene Jun 04 '19 at 07:42
  • Note that the cited sentence is part of the description of the `-Xcomp` option. The options `-client` and `-server` itself are not specified on the entire page. It’s a kind of dangling cross reference when the documentation for the `-Xcomp` option mentions the defaults which are supposed to be overridden by this option. – Holger Jun 04 '19 at 09:23