Skip to content

Commit 3056ba4

Browse files
authored
Update ReadMe
1 parent 6b09390 commit 3056ba4

File tree

1 file changed

+27
-13
lines changed

1 file changed

+27
-13
lines changed

ReadMe

+27-13
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,51 @@
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 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

33+
10) You can now checkpoint java code:
34+
sudo setsid java -XX:+UseSerialGC -XX:-UsePerfData -Djava.library.path=$LOAD_LIBRARY_PATH TestRandom 1000000 1000
35+
36+
11) And restore
37+
sudo bash
38+
cd /home/chf/SavedWorlds/run<x>
39+
criu restore --shell-job
40+
41+
42+
Known Issues:
43+
2644
There is currently a problem with a socket file which is causing tests to fail. The short term fix is to delete this file.
2745
I did rm -rf rm -f /var/lib/sss/pipes/nss
2846
I'm working on addressing this problem.
2947

30-
You can now checkpoint java code:
31-
sudo setsid java -XX:+UseSerialGC -XX:-UsePerfData -Djava.library.path=$LOAD_LIBRARY_PATH TestRandom 1000000 1000
48+
Saving Performance Data causes the generation of open files which can't be closed.
3249

33-
and restore:
50+
ParallelGC causes an issue.
3451

35-
sudo bash
36-
cd /home/chf/SavedWorlds/run<x>
37-
criu restore --shell-job

0 commit comments

Comments
 (0)