Giter VIP home page Giter VIP logo

crac-demo's Introduction

  • Clone the project
git clone [email protected]:tzolov/crac-demo.git
  • Change directory to the crac-demo folder and build:
mvn clean install

under target you will see the crac-demo-1.0.0-SNAPSHOT-shaded.jar uber jar.

  • From within the crac-demo folder run the java_17_crac container:
docker run --network "host" -it --privileged --rm --name=my-crac-app -v $(pwd)/target:/opt/mnt tzolov/java_17_crac:latest /bin/bash

The java_17_crac uses Ubuntu-22.04 and pre-installs JDK 17 CRaC + 5. Here is the Dockerfile.

  • Start the crac-demo application inside the running container:
java -XX:CRaCCheckpointTo=/opt/crac-files -jar /opt/mnt/crac-demo-1.0.0-SNAPSHOT-shaded.jar

wait for 15-20 seconds until you see printout like 0:1:2:3:4:5...

  • From another terminal trigger the CRaC checkpoint:
docker exec -it  --privileged -u root my-crac-app jcmd /opt/mnt/crac-demo-1.0.0-SNAPSHOT-shaded.jar JDK.checkpoint

later creates the checkpoint under the container's /opt/crac-files folder and stops the original application.

  • In the first terminal (e.g. the running my-crac-app container) restart the application from the checkpoint:
java -XX:CRaCRestoreFrom=/opt/crac-files

crac-demo's People

Contributors

antonkozlov avatar tzolov avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.