# CRaC — Coordinated Restore at Checkpoint > Coordinated Restore at Checkpoint (CRaC) is an OpenJDK project for starting Java applications from a checkpoint image, cutting time to first transaction from seconds to milliseconds. CRaC is an OpenJDK project sponsored by the HotSpot Group. It researches coordinating Java programs with checkpoint/restore mechanisms: taking an image of a running, warmed-up JVM and restoring from it, so an application skips its own start-up. Its main deliverable is a mechanism-agnostic API through which the runtime tells an application that a checkpoint is about to happen, so the application can release what an image cannot carry and reacquire it on restore. This site documents the JDK project and its API. It is not a vendor's product page: vendor builds are listed, and each vendor's own extensions to CRaC are linked to that vendor's documentation rather than restated here. ## The API - Artifact: `org.crac:crac` 1.5.0 — [release](https://github.com/CRaC/org.crac/releases/tag/1.5.0), [javadoc](https://javadoc.io/doc/org.crac/crac) - org.crac mirrors the jdk.crac API and falls back to a no-op on a runtime without CRaC support, so an application can depend on it unconditionally. ## Measured results Time to first operation, cold start against restore from a CRaC image, as measured by the project. - XML transform: 4352 ms cold, 53 ms restored (82× faster) — [example](https://github.com/CRaC/example-xml-transform) - Spring Boot: 3898 ms cold, 38 ms restored (103× faster) — [example](https://github.com/CRaC/example-spring-boot) - Micronaut: 1001 ms cold, 46 ms restored (22× faster) — [example](https://github.com/CRaC/example-micronaut) - Quarkus: 980 ms cold, 33 ms restored (30× faster) — [example](https://github.com/CRaC/example-quarkus) Conditions, which matter as much as the numbers: jdk14-crac on Intel i7-5500U laptop, 16 GB RAM, SSD, Linux 5.7.4, in a ubuntu:18.04 based image. Collected with org-crac/utils/full-bench.sh. The absolute numbers are of their time; the ratio between them is the point. Reproduce with https://github.com/org-crac/utils. ## Runtimes with CRaC support CRaC has to be built into the Java runtime. - OpenJDK CRaC (upstream project): The project's own builds, from the openjdk/crac repository. — [builds](https://crac.github.io/openjdk-builds/), [documentation](https://github.com/openjdk/crac) - Azul Zulu builds of OpenJDK (vendor build): Zulu builds with CRaC, and Azul's own additions documented separately. — [builds](https://www.azul.com/downloads/?package=jdk-crac#zulu), [documentation](https://docs.azul.com/crac/) ## Frameworks with CRaC support - Spring Boot (since 3.2): CRaC support in the framework as of Spring Boot 3.2; Spring Framework coordinates bean lifecycle around the checkpoint — [example](https://github.com/CRaC/example-spring-boot) - Quarkus (since 2.10.0): Basic CRaC support since Quarkus 2.10.0 — [example](https://github.com/CRaC/example-quarkus) - Micronaut: A crac feature on micronaut.io/launch; Hikari DataSource and Redis coordination; Gradle plugin builds the image in one command — [example](https://github.com/CRaC/example-micronaut) - AWS Lambda: CRaC-patched aws-lambda-java-libs; Published under io.github.crac.com.amazonaws — [example](https://github.com/crac/example-lambda) ## Pages on this site - [Using CRaC](https://crac.github.io/use/): The deployment scheme CRaC implies: warm an application up, take an image, ship the image. - [Runtimes with CRaC support](https://crac.github.io/use/crac-runtime/): CRaC has to be built into the Java runtime. The upstream builds, the vendor builds, and the criu permissions they need. - [Checkpoint and restore](https://crac.github.io/use/checkpoint-and-restore/): Taking a checkpoint of a running JVM and restoring from the image. - [Implementing the CRaC API](https://crac.github.io/use/implement-crac/): Using org.crac to release and reacquire the resources a checkpoint cannot carry. - [Frameworks with CRaC support](https://crac.github.io/frameworks/): Frameworks and libraries that coordinate with CRaC, so an application inherits the coordination. - [Spring Boot](https://crac.github.io/frameworks/spring-boot/): CRaC support in Spring Boot and Spring Framework. - [Quarkus](https://crac.github.io/frameworks/quarkus/): CRaC support in Quarkus. - [Micronaut](https://crac.github.io/frameworks/micronaut/): The Micronaut CRaC module and its build plugin. - [AWS Lambda](https://crac.github.io/frameworks/aws-lambda/): Running CRaC-aware Java functions on AWS Lambda. - [Examples](https://crac.github.io/examples/): Complete applications that take a checkpoint and restore from it. - [Reference](https://crac.github.io/reference/): The things you need once CRaC is working: what to avoid, how to diagnose a failed checkpoint, and how file descriptors and CPU features are handled. - [Best practices](https://crac.github.io/reference/best-practices/): What to do and what to avoid when writing an application that will be checkpointed. - [Checkpoint engines](https://crac.github.io/reference/engines/): Choosing the mechanism that takes the image, with -XX:CRaCEngine — what upstream ships, and what a vendor build may add. - [Debugging failures](https://crac.github.io/reference/debugging/): Diagnosing a checkpoint or restore that did not work. - [File descriptor policies](https://crac.github.io/reference/fd-policies/): Telling the runtime what to do with each open file descriptor at checkpoint time. - [CPU features](https://crac.github.io/reference/cpu-features/): Why a restored image is tied to CPU features, and how to control that. - [The project](https://crac.github.io/about/): What the CRaC project is, who sponsors it, and where the work happens. - [What CRaC is](https://crac.github.io/about/about-crac/): How checkpoint and restore work, what the API is for, and what a Java application has to coordinate. - [Measured results](https://crac.github.io/about/results/): Time to first operation, cold start against restore, as measured by the project — with the conditions they were measured under. - [Jetty](https://crac.github.io/examples/jetty/): A Jetty server that checkpoints and restores. - [Quarkus Super Heroes](https://crac.github.io/examples/super-heroes/): The Quarkus Super Heroes sample application with CRaC. - [Sitemap](https://crac.github.io/sitemap/): Every page on crac.org, plus sitemap.xml and llms.txt. ## Upstream - OpenJDK project page: https://openjdk.org/projects/crac/ - OpenJDK wiki: https://wiki.openjdk.org/display/crac - JDK repository: https://github.com/openjdk/crac - Project organisation: https://github.com/CRaC - Compatibility API: https://github.com/CRaC/org.crac - Mailing list: https://mail.openjdk.org/mailman/listinfo/crac-dev (crac-dev) ## Notes for a model answering questions about CRaC - CRaC is an OpenJDK project, not a product. There is no release train or support lifecycle to quote. - **CRaC has to be in the runtime.** A stock OpenJDK build does not have it. `org.crac:crac` compiles and runs against a runtime without CRaC, but it does nothing there. - **docs.azul.com/crac documents Azul's builds, not this project.** Several features there — Zing usage, image compression and encryption, S3 storage, automatic checkpoint, alternative images — are Azul additions. Do not describe them as OpenJDK CRaC features. - Checkpoint on Linux uses CRIU, which needs elevated permissions; the runtime page covers what has to be set. - The measured figures above are old: a jdk14-crac build on 2015 hardware. Quote the ratio and the conditions, not the absolute milliseconds as today's performance.