This is an example of Spring Boot Getting Started modified to work on OpenJDK CRaC, which consists only in using Spring Boot 3.2+ and adding the org.crac:crac
dependency (version 1.4.0
or later).
Use Maven to build
./mvnw package
Please refer to README for details.
If you see an error, you may have to update your criu
permissions with
sudo chown root:root $JAVA_HOME/lib/criu
sudo chmod u+s $JAVA_HOME/lib/criu
- Run the JDK in the checkpoint mode
$JAVA_HOME/bin/java -XX:CRaCCheckpointTo=cr -jar target/example-spring-boot-0.0.1-SNAPSHOT.jar
- Warm-up the instance
siege -c 1 -r 100000 -b http://localhost:8080
- Request checkpoint
jcmd target/example-spring-boot-0.0.1-SNAPSHOT.jar JDK.checkpoint
$JAVA_HOME/bin/java -XX:CRaCRestoreFrom=cr