1

On 64 bit linux, with java8, when running java command, it seems all the 3 options -client / -server / -d64 are using the 64-bit server compiler.

The questions are: (for 64bit linux with java8)

  • Since -client and -server use the same compiler, does it makes any difference to specify one of the 2 options?
  • For a long running java daemon program, is it preferred to use -server together with -XX:+TieredCompilation or without it, when during the startup time it's ok to be a little slow.
Eric
  • 22,183
  • 20
  • 145
  • 196
  • You are mistaken. `-client` and `-server` select different JVMs. – user207421 Mar 07 '16 at 04:10
  • @EJP I think the 2 options choose different JIT compiler, which compile bytecode to machine code, which is in running time, and thus result in 2 type of java process with different behavior. Since a jvm is just a java process, so, it's ok for you to say that they choose different jvms. – Eric Mar 07 '16 at 04:46

1 Answers1

3

Look at the file jre/lib/amd64/jvm.cfg. You'll likely see the lines

-server KNOWN
-client IGNORE

This means that -client option is ignored. -server also does nothing, since JDK 8 for x64 has only one JVM that includes both C1 and C2 compilers, and the tiered compilation is on by default.

with -XX:+TieredCompilation or without it

Does not matter, because this option is on by default. The advanced compilation policy works fine for both client-grade and server-grade applications. There is no usually need to turn it off manually.

Community
  • 1
  • 1
apangin
  • 92,924
  • 10
  • 193
  • 247