Skip to content

Commit dfdd116

Browse files
committed
Merge branch 'master' of https://github.com/chflood/CRIUForJava
2 parents 2e13d9d + 3056ba4 commit dfdd116

File tree

1 file changed

+26
-13
lines changed

1 file changed

+26
-13
lines changed

ReadMe

+26-13
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,49 @@
11
This is demo code to show how to use CRIU (Checkpoint Restore In Userspace) from Java.
22

33
It's very much a prototype. There are many caveats in this file. Please try it and let me know how it goes.
4-
54

6-
Make sure criu is running from the directory that has the socket file.
7-
[cflood@cflood FromInsideJava]$ sudo /home/cflood/criu/criu-latest/criu/criu service
5+
1) Make sure CRIU is enabled in your kernel
6+
sudo grep CHECKPOINT /boot/config-*
7+
8+
2) Make sure you are running criu version 3.11 or higher
9+
10+
3) Make sure criu service is running (socket create) in the same directory as your socket file.
11+
sudo criu service&
812
Warn (criu/cr-service.c:1160): Binding to local dir address!
913

10-
Make sure kernel is compiled with CR turned on
11-
sudo grep CHECKPOINT /boot/config-*
14+
4) One last check
15+
sudo criu check
1216

17+
5) Compile the java file
1318
javac CheckpointRestore.java
1419

20+
6) Generate the .h file
1521
javah CheckpointRestore
1622

23+
7) Make it into a .hpp file
1724
mv CheckpointRestore.h CheckpointRestore.hpp
1825

19-
Make sure criu is installed and libcriu is on your library path. I set mine via
26+
8) Make sure criu is installed and libcriu is on your library path. I set mine via
2027
export LOAD_LIBRARY_PATH=/usr/lib64:./
2128
There is probably a better way
2229

23-
Build the criu library.
30+
9) Build the criu library.
2431
gcc -shared -fPIC -I/usr/lib/jvm/java-openjdk/include -I/usr/lib/jvm/java-openjdk/include/linux -I/usr/lib64/ -I/usr/include/criu -lcriu -o libCheckpointRestore.so CheckpointRestore.cpp
2532

26-
There is currently a problem with a socket file which is causing tests to fail. The short term fix is to delete this file.
27-
I did rm -rf rm -f /var/lib/sss/pipes/nss
28-
I'm working on addressing this problem.
29-
30-
You can now checkpoint java code:
33+
10) You can now checkpoint java code:
3134
sudo setsid java -XX:+UseSerialGC -XX:-UsePerfData -Djava.library.path=$LOAD_LIBRARY_PATH TestRandom 1000000 1000
3235

33-
This will print out the restore instructions which you can run as root:
36+
11) The command to restore will be printed during checkpointing. Mine was:
3437

3538
sudo java -XX:+UseSerialGC -XX:-UsePerfData -Djava.library.path=$LOAD_LIBRARY_PATH TestRandomRestore <saved world directory>
3639

40+
41+
Known Issues:
42+
43+
There is currently a problem with a socket file which is causing tests to fail. The short term fix is to delete this file.
44+
I did rm -rf rm -f /var/lib/sss/pipes/nss
45+
I'm working on addressing this problem.
46+
47+
Saving Performance Data causes the generation of open files which can't be closed.
48+
49+
ParallelGC causes an issue.

0 commit comments

Comments
 (0)