简体   繁体   中英

Mixing JDK/JRE Hotspot/OpenJ9

I'm wondering if it matters to use the same JRE as the JDK that was used for compilation.

For example I compile with OpenJ9(v12) then run my server with Hotspot(v12).

What kind of problem can arise? What about performance?

Should I prefer

  • JDK OpenJ9/JRE OpenJ9
  • JDK Hotspot/JRE Hotspot

Or can I mix - JDK OpenJ9/JRE Hotspot - JDK Hotspot/JRE OpenJ9

Would performance be impacted by JRE only? or both ?

OpenJ9 and Hotspot are 2 implementation of Java virtual machine (JVM), JVM in turn is a part of a JDK

JDK OpenJ9 and JDK Hotspot are OpenJDK packed with different JVMs, it must be true that both generate same bytecodes: oj9_faq

The different between them is how they run bytecode, in short there are 3 differents

  • Command line options
  • Garbage controller policy
  • Code that use com.sun.management interfaces

moving-to-openjdk-with-eclipse-openj9

Performance impact can only determined by trying, it depends on the nature of your application.

You should expect the two JDKs to generate the same bytecode because they both use the the same java compiler from OpenJDK. The differences, as lolacoco said, will be at runtime due to differing VM and GC implementations. Even if you generated the bytecode with a different compiler (eg the one in the eclipse IDE), that bytecode should run on any VM.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM