This is a sample project to demonstrate Spring Boot 3.2+ CRaC support by creating a checkpoint and then restoring your application using it.
- Download JDK 17 with CRaC support provided by Azul From here and install it. This one is for Debian based OS like Ubuntu.
sudo dpkg -i zulu17.58.25-ca-crac-jdk17.0.15-linux_amd64.deb
- Grant appropriate permissions for CRIU to be functional. Note that you need to be present in your java home directory of the JDK you downloaded in previous step.
sudo chown root:root ./lib/criu
sudo chmod u+s ./lib/criu
mvn clean package
/usr/lib/jvm/zulu-17-crac-amd64/bin/java -XX:CRaCCheckpointTo=./tmp_chkpoint -jar ./target/crac-demo-0.0.1-SNAPSHOT.jar
Find the PID of the running instance and use it to create an application checkpoint:
jcmd 189254 JDK.checkpoint
Restore and bring your instance back up:
/usr/lib/jvm/zulu-17-crac-amd64/bin/java -XX:CRaCRestoreFrom=./tmp_chkpoint