Combining Azul Zing with ReadyNow and CRaC
You can combine ReadyNow with CRaC by copying the profile files separately into the restore image (it is not automatically stored in the image directory).
Steps to use ReadyNow with CRaC:
-
First do a long enough profiling run with load to generate the
ProfileLogOut
file, without issuing a checkpoint. -
Start the process again with
-XX:ProfileLogin
pointing to the profile generated in first step,-XX:ProfileLogOut
pointing to a different file path, and with-XX:CRaCCheckpointTo
set to the image directory. -
Once most compilations are completed (this may need load to get classes initialized), issue a checkpoint using
jcmd
. -
Copy both the ProfileLogin and ProfileLogOut files from the second step to the same path in the restore Docker image.
-
Restore the process using
-XX:CRaCCheckpointTo
.
Checkpoint at main
Using ReadyNow
Since ReadyNow cannot issue compilations before classes are initialized, there may be a lot of compilations still left to do at main
. Further, this also means the Java heap and other VM/application data structures do not benefit from CRaC.
If you use -XX:ProfileStartupLimitInSeconds=-1
and -XX:+CRaCCheckpointAtMain
along with ProfileLogIn
, ProfileLogOut
, and CRaCCheckpointAtMain
, the checkpoint is issued automatically before the Java main
function is executed.