Checkpoint and Restore With the JVM
| This version is still in development and is not considered stable yet. For the latest stable version, please use Spring Boot 4.1.1! |
Coordinated Restore at Checkpoint (CRaC) is an OpenJDK project that defines a new Java API to allow you to checkpoint and restore an application on the HotSpot JVM. It is based on CRIU, a project that implements checkpoint/restore functionality on Linux.
The principle is the following: you start your application almost as usual but with a CRaC enabled version of the JDK like BellSoft Liberica JDK with CRaC or Azul Zulu JDK with CRaC.
Then at some point, potentially after some workloads that will warm up your JVM by executing all common code paths, you trigger a checkpoint using an API call, a jcmd command, an HTTP endpoint, or a different mechanism.
A memory representation of the running JVM, including its warmness, is then serialized to disk, allowing a fast restoration at a later point, potentially on another machine with a similar operating system and CPU architecture. The restored process retains all the capabilities of the HotSpot JVM, including further JIT optimizations at runtime.
Based on the foundations provided by Spring Framework, Spring Boot provides support for checkpointing and restoring your application, and manages out-of-the-box the lifecycle of resources such as socket, files and thread pools . Additional lifecycle management is expected for other dependencies and potentially for the application code dealing with such resources.
You can find more details about the two modes supported (“on demand checkpoint/restore of a running application” and “automatic checkpoint/restore at startup”), how to enable checkpoint and restore support and some guidelines in the Spring Framework JVM Checkpoint Restore support documentation.
- Related Spring Documentation
- Spring Boot
- Spring Framework
- Spring Cloud
- Spring Cloud Build
- Spring Cloud Bus
- Spring Cloud Circuit Breaker
- Spring Cloud Commons
- Spring Cloud Config
- Spring Cloud Consul
- Spring Cloud Contract
- Spring Cloud Function
- Spring Cloud Gateway
- Spring Cloud Kubernetes
- Spring Cloud Netflix
- Spring Cloud OpenFeign
- Spring Cloud Stream
- Spring Cloud Task
- Spring Cloud Vault
- Spring Cloud Zookeeper
- Spring Data
- Spring Integration
- Spring Batch
- Spring Security
- Spring AI
- Spring AMQP
- Spring CLI
- Spring GraphQL
- Spring for Apache Kafka
- Spring Modulith
- Spring for Apache Pulsar
- Spring Shell All Docs...
