Directory path where the checkpoint must be created. The value is required.
CRaC Command-Line Options and System Properties
Command-Line Options
Java command-line options that control the behavior of CRaC.
Command Line Option | Description | Default |
---|---|---|
-XX:CRaCCheckpointTo=<value> |
||
-XX:CRaCRestoreFrom=<value> |
The directory path where the CRaC image is stored which must be used for the restore. It replaces the initializing virtual machine on successful restore. The value is required. |
|
-XX:+/-CRaCKeepRunning |
Flag defining to not terminate the process after the checkpoint. |
false |
-XX:+/-CRaCConcurrentMemoryLoading |
Used for restore to start the restored process before the image is fully unpacked into memory. As applications usually don’t require all data to perform some useful work, this can improve the startup lag. Direct memory mapping (non-compressed) is extremely fast compared to regular loading. Compressed images are slower as they need to be uncompressed. |
false |
-XX:CRaCOptimizeImage=<value> |
After checkpoint, the image can be automatically reordered, based on the loading order in the profiling runs. This option sets the number of profiling runs. The default value of 0 means no optimization. With Warp, you can use the option |
0 |
-XX:CRaCMinPid=<value> |
The minimal PID value for a process that is restored. See Debugging Coordinated Restore at Checkpoint Failures > Using the CRaCMinPid Option. The default value is 128 only if the Java process is started with PID 1 (e.g., in a container). For processes started with a different PID, the PID is not adjusted unless this option is set. |
128 |
-XX:+/-CRaCResetStartTime |
Reset JVM’s start time and uptime on restore. |
true |
-XX:CRaCEngine=<value> |
Integrated engines in Zulu:
|
criu |
-XX:+/-CRaCIgnoredFileDescriptors |
Ignore |
false |
-XX:CRaCIgnoredFileDescriptors=<value> |
Comma-separated list of file descriptor numbers or paths. All the file descriptors greater than 2 (stdin, stdout and stderr are excluded automatically), that are not in this list, are closed when the VM starts. |
null |
-XX:CRaCAllowedOpenFilePrefixes=<value> |
List of path prefixes for files that can be open during the checkpoint. CRaC won’t throw an error upon detecting these and leaves the handling up to the Checkpoint/Restore engine. This option applies only to files opened by native code. For files opened by Java code use |
|
-XX:+/-CRaCImageCompression |
Compress the CRaC image during the checkpoint. Upon restore, the compressed format is detected automatically. |
false |
-XX:+/-CRaCHeapDumpOnCheckpointException |
Dump the heap when a |
false |
-XX:+/-CRaCPrintResourcesOnCheckpoint |
Print the resources used to decide on a CheckpointException. This is a diagnostic feature and must be preceded with |
false |
-XX:+/-CRaCTraceStartupTime |
Trace the startup time. |
false |
-XX:+/-CRaCDoThrowCheckpointException |
Throw |
true |
-XX:CRaCMaxHeapSizeBeforeCheckpoint=<value> |
The maximum size of the heap before the checkpoint. By default, this equals to |
0 |
-XX:CPUFeatures=<value> |
The CPU feature set. Use
|
native |
-XX:+/-ShowCPUFeatures |
Show the features of this CPU to be possibly used for the |
false |
-XX:+/-IgnoreCPUFeatures |
EXPERIMENTAL! Flag defining to continue to run after |
false |
System Properties
The following system properties for CRac can be set:
-
jdk.crac.resource-policies
: see File Descriptor Policies -
jdk.crac.collect-fd-stacktraces
: see Debugging Coordinated Restore at Checkpoint Failures > File Descriptors in Java Code -
jdk.crac.trace-startup-time=true
: add this to print startup time values to track how long the Java-side of the restore takes. This prints to stdout:-
STARTUPTIME <SYSTEM NANOTIME> restore
-
STARTUPTIME <SYSTEM NANOTIME> restore-finish
-
-
jdk.crac.globalContext.impl
: this property has two options:-
OrderedContext
(default): Lets you register the resource when the checkpoint/restore is already executing, but this Resource’sbeforeCheckpoint()
andafterRestore()
methods won’t be called during this checkpoint/restore. -
BlockingOrderedContext
: Lets you assert that there is no new Resource registered during execution of the checkpoint/restore. The thread trying to register a new resource is blocked (this can lead to a deadlock).
-
Set these properties when you execute Java, for example:
java -XX:CRaCCheckpointTo=... -Djdk.crac.resource-policies=/path/to/file.yml ...