JITServer technology
Linux® on x86, Linux on IBM Power® systems, Linux on AArch64 and Linux on IBM Z® systems (64-bit only)
JITServer technology decouples the JIT compiler from the VM and lets the JIT compiler run remotely in its own process. This mechanism prevents your Java™ application suffering possible negative effects due to CPU and memory consumption caused by JIT compilation.
This technology can improve quality of service, robustness, and performance of Java applications. You might want to try this technology if the following criteria are met:
- Your Java application is required to compile many methods using JIT in a relatively short time.
- The application is running in an environment with limited CPU or memory, which can worsen interference from the JIT compiler.
- The network latency between JITServer and client VM is relatively low.
For more details about JITServer technology, including its advantages and disadvantages and when best to use it, see blog posts such as the following:
- Free your JVM from the JIT with JITServer Technology
- JITServer - Optimize your Java cloud-native applications
For a more in-depth description of the JITServer design and implementation, see the following research paper:
Using JITServer technology
JITServer technology is not enabled by default: you must explicitly invoke it. Running OpenJ9 without either of the following options launches it as a regular VM with embedded JIT compilation.
Launch Eclipse OpenJ9 in client mode
Use the following command-line option to launch Eclipse OpenJ9™ in client mode. In this mode, the VM sends compilation requests to an available JITServer. The client operates as a regular VM with its own JIT compiler if a server is not available.
-XX:+UseJITServer
Launch OpenJ9 in server mode
Use the following command to start a JITServer process that listens for incoming compilation requests:
jitserver
Configuring JITServer technology
You can use command line options to further configure the JITServer and the client VM processes. For example:
-XX:JITServerPort=<port>
: Specifies the port the server listens to for compilation requests-XX:JITServerAddress=<address>
: Specifies the name or IP of the server-XX:JITServerTimeout=<timeout>
: Specifies a timeout value in milliseconds for socket operations-XX:[+|-]JITServerShareROMClasses
: Specifies whether the server shares cached ROM classes between clients-XX:[+|-]JITServerLocalSyncCompiles
: Improves performance for real-time applications by compiling synchronous JIT compilations locally, with a remote asynchronous recompilation scheduled at a later point-XX:[+|-]JITServerLogConnections
: Enables logging of connection/disconnection events between the server and the client-XX:[+|-]JITServerMetrics
: Specifies whether the JITServer custom metrics exporter is enabled or disabled-XX:JITServerMetricsPort=<port>
: Specifies the port number on which the JITServer metrics are provided to a monitoring agent-XX:JITServerAOTCacheName=<cache_name>
: Specifies the name of the server-side AOT cache to use-XX:[+|-]JITServerUseAOTCache
: Specifies whether the server caches AOT-compiled methods-XX:JITServerAOTmx=<size>
: Specifies the maximum amount of memory that can be used by the JITServer AOT cache-XX:[+|-]JITServerAOTCachePersistence
: Specifies whether the JITServer server allows other JITServer instances to reuse AOT caches-XX:JITServerAOTCacheDir=<directory>
: Specifies the directory to be used for saving and loading JITServer AOT cache files
If a JITServer server crashes, the client is forced to perform compilations locally. You can change this behavior by using the -XX:[+|-]RequireJITServer
option so that the client crashes with an assert when it detects that the server is unavailable. This feature is useful when you are running a test suite with JITServer enabled and you want the server crash to cause the test to fail.
Security
You can encrypt network communication between the client VM and JITServer by using OpenSSL 1.0.x, 1.1.x, or 3.x. To enable encryption, you specify the private key and the certificate at the server and use the certificate at the client. For more information, see -XX:JITServerSSLCert / -XX:JITServerSSLKey / -XX:JITServerSSLRootCerts.
Tuning JITServer
For best practices regarding JITServer configuration and tuning, see the document JITServer tuning and practical considerations.
Building a JDK with JITServer technology
If you want to build a JDK with JITServer technology, see Appendix A of Free your JVM from the JIT with JITServer Technology.