[crac] RFR: Provide arguments for restore
Anton Kozlov
akozlov at openjdk.java.net
Fri Feb 11 12:03:04 UTC 2022
On Fri, 11 Feb 2022 11:56:10 GMT, Anton Kozlov <akozlov at openjdk.org> wrote:
> This change adds a new API and implementation to receive a new set of command-line arguments in the restored Java instance. The supplied demo code shows a faster replacement for `javac`.
>
> The current implementation obligates the first argument of the new set not to start with the dash, otherwise, the java launcher will interpret it as its own parameter. So the first argument should be a "verb" similar to the Main class.
The workflow for checkpoint could be:
$BUILDDIR/images/jdk/bin/java
-XX:CRaCCheckpointTo=$CRDIR
-Xshare:off # disable CDS for faster start after restore
-XX:-UsePerfData # disable jps for
-jar $BUILDDIR/images/jdk/demo/crac/JavaCompilerCRaC/JavaCompilerCRaC.jar
# provide a set of warm-up workloads
-nowarn -d tmp @${BUILDDIR}/jdk/modules/java.base/_the.java.base_batch.filelist --
-nowarn -XDignore.symbol.file=true -d tmp @${BUILDDIR}/jdk/modules/java.desktop/_the.java.desktop_batch.filelist --
-nowarn -XDignore.symbol.file=true -d tmp @${BUILDDIR}/jdk/modules/java.xml/_the.java.xml_batch.filelist
And after that, compile anything by
$BUILDDIR/images/jdk/bin/java
-XX:CRaCRestoreFrom=$CRDIR
Compile # does not mean anything
"${TARGET_ARGS[@]}"
Or more concrete:
$ time jdk/bin/java -XX:CRaCRestoreFrom=./cr Compile HelloWorld.java
real 0m0.124s
user 0m0.269s
sys 0m0.075s
$ time jdk/bin/javac HelloWorld.java
real 0m0.380s
user 0m0.817s
sys 0m0.072s
-------------
PR: https://git.openjdk.java.net/crac/pull/16
More information about the crac-dev
mailing list