Skip to content

CAUTION: This site hosts draft documentation for the next release. For published content of the latest release, visit www.eclipse.org/openj9/docs

-XX:[+|-]EnableCRIUSupport

(Linux® x86, Linux on POWER® (Little Endian), Linux on AArch64, and Linux on IBM Z® only)

This option enables or disables support for Checkpoint/Restore In Userspace (CRIU).

Restrictions: If CRIU support is enabled,

  • you cannot use a Java™ security manager. If you try to specify a Java security manager, for example by using the -Djava.security.manager system property on the Java command line or the java.lang.System.setSecurityManager method in your application, the VM throws the java.lang.UnsupportedOperationException error.
  • By default, CRIUSECProvider is the only security provider that is available in the checkpoint phase until restore. Start of content that applies to Java 11 (LTS) and later But, you can continue to use the existing security providers by disabling CRIUSECProvider with the -XX:-CRIUSecProvider option. End of content that applies to Java 11 (LTS) and later
  • JITServer is disabled in the checkpoint phase even if the server exists and you have specified the -XX:+UseJITServer option. When you specify the -XX:+EnableCRIUSupport and -XX:+CRIURestoreNonPortableMode options along with the -XX:+UseJITServer option, and the server exists, the VM enables the JITServer server automatically at the restore point. The VM client connects to a JITServer in the context of CRIU as outlined in the following table (where yes means that the VM connects to a JITServer instance and no means that the VM does not connect to a JITServer instance):
Nonportable mode (default)
Pre-checkpoint
Nonportable mode (default)
Post restore
Portable mode Pre-checkpoint Portable mode Post restore
Pre-checkpoint: No options
Post restore: No options
no no no no
Pre-checkpoint: No options
Post restore: -XX:+UseJITServer
no yes no yes
Pre-checkpoint: -XX:+UseJITServer
Post restore: No options
no yes yes yes
Pre-checkpoint: -XX:+UseJITServer
Post restore: -XX:-UseJITServer
no no yes no
Pre-checkpoint: -XX:-UseJITServer
Post restore: -XX:+UseJITServer
no no no no
  • you cannot use the balanced and metronome garbage collection (GC) policies. If you use the -Xgcpolicy:balanced or -Xgcpolicy:metronome options to specify those policies, the VM throws the following errors:

    JVMJ9GC090E -Xgcpolicy:balanced is currently unsupported with -XX:+EnableCRIUSupport JVMJ9VM007E Command-line option unrecognised: -Xgcpolicy:balanced Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

    JVMJ9GC090E -Xgcpolicy:metronome is currently unsupported with -XX:+EnableCRIUSupport JVMJ9VM007E Command-line option unrecognised: -Xgcpolicy:metronome Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

Syntax

    -XX:[+|-]EnableCRIUSupport
Setting Effect Default
-XX:+EnableCRIUSupport Enable
-XX:-EnableCRIUSupport Disable yes

Explanation

When you enable the option, the VM starts with the support for checkpoint and restore processes. The VM starts the JIT, GC, Security, and other internal components that make the checkpoint and restore points feasible. The option enables the use of org.eclipse.openj9.criu.CRIUSupport APIs. With CRIU support, you can take a checkpoint of the VM and restore the checkpoint image. When you specify the -XX:+EnableCRIUSupport option, the VM generates only those compiled codes that are portable (see -XX:[+|-]PortableSharedCache) to facilitate restoring of the checkpoint image in multiple environments. VM does not load any code from the shared classes cache that is nonportable pre-checkpoint.

Taking a checkpoint and restoring the checkpoint image generally happens on different environments with different behaviors. OpenJ9 makes compensations for such differences to ensure successful restore. For example, the VM compensates for the downtime between checkpoint and restore for elapsed time sensitive APIs such as System.nanotime() and java.util.Timer.

For more information about the OpenJ9 compensations and Time APIs, see the Compensation section in the OpenJ9 CRIU Support: A look under the hood (part II) blog post.

See also