1

Strangely enough, I was not able to find official documentation on -client and -server java options and what are exact differences between server hotspot JRE and client hotspot JRE.

Can anyone point me out to official documentation or unofficial research?

Sergey Alaev
  • 3,851
  • 2
  • 20
  • 35
  • I think this is a legit question in 2021 given that JRE is no longer a thing (except for Adoptium which still builds them). – Petr Janeček Dec 22 '21 at 10:59
  • Linked answer is very old and probably no longer valid for newest JDK – Sergey Alaev Dec 22 '21 at 11:03
  • I definitely think the actual difference is the same - less advanced JIT compilation (no C2?), less aggressive settings. The question is whether it's even possible to get a client JDK nowadays. On my end (Temurin 17 on Mac OS) `-client` is simply ignored. I see some "client" mentions on https://docs.oracle.com/en/java/javase/11/tools/java.html, but none on https://docs.oracle.com/en/java/javase/17/docs/specs/man/java.html. The linked question also says _"A 64-bit capable JDK currently ignores this option and instead uses the Java Hotspot Server VM."_. So, why are you looking into this? – Petr Janeček Dec 22 '21 at 11:38
  • The last place where I can see `-client` explicitly documented is on Java 8: https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html#BABDJJFI. – Petr Janeček Dec 22 '21 at 11:43
  • @SergeyAlaev I think that you edit the question and emphasize that you mean *specifically* JDK 17, the question *may* be reopened. – MC Emperor Dec 22 '21 at 11:51
  • 2
    Since Oracle only provides 64 bit server JVMs, it makes sense that there’s no documentation for these ineffective options. Other JDK builds may still have client and server JVMs; just look into the `bin` directory. If both subdirectories, `client` and `server` are present, the option can make a difference. – Holger Dec 22 '21 at 15:34
  • ...I just looked at some random x86 builds and indeed, both Azul Zulu 17 for Linux x86 and Adoptium Temurin 17 for Windows x86 have the client JVM in them. Once again, why is this interesting / important in 2021? I'm curious! – Petr Janeček Dec 22 '21 at 15:47
  • 1
    Because jdk17 supports -client and even enables it for environments with limited resources including Kubernetes pods. – Sergey Alaev Dec 23 '21 at 11:10

0 Answers0