Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8370204

Add jcmd AOT.end_recording diagnostic command

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Unresolved
    • Icon: P4 P4
    • 26
    • hotspot
    • None
    • svc
    • minimal
    • New jcmd, no compatibility impact
    • add/remove command in $JDK/bin
    • JDK

      Summary

      Add jcmd <pid> AOT.end_recording to end an AOT training run that's in progress and record the AOT training artifacts to the file(s) that have been specified in the JVM command-line.

      Problem

      There is currently no jcmd support support for AOT cache creation. The command-line option -XX:AOTCacheOutput creates the cache only when the current JVM exits. This is not suitable for application that never exits, or for applications that want to create the AOT cache before the JVM exits.

      Solution

      Here's an example of using jcmd <pid> AOT.end_recording on a process that runs forever. The training run is ended and the JVM records the AOT cache "Wait.aot" that was specified in the command line for process 2963961.

      $ ava -cp Wait.jar -XX:AOTCacheOutput=Wait.aot Wait &
      [2] 2963961
      
      $ jcmd 2963961 AOT.end_recording
      2963961:
      Temporary AOTConfiguration recorded: Wait.aot.config
      Launching child process /myjdk/bin/java to assemble AOT cache Wait.aot using configuration Wait.aot.config
      Picked up JAVA_TOOL_OPTIONS: -Djava.class.path=Wait.jar -XX:AOTCacheOutput=Wait.aot -XX:AOTConfiguration=Wait.aot.config -XX:AOTMode=create
      Reading AOTConfiguration Wait.aot.config and writing AOTCache Wait.aot
      AOTCache creation is complete: Wait.aot 10891264 bytes
      Removed temporary AOT configuration file Wait.aot.config
      Recording ended successfully

      Specification

      The jcmd man page is updated to add AOT.end_recording with the following description:

      If an AOT training is in progress, end the AOT training and record the results
      to the file(s) specified by -XX:AOTConfiguration and/or  -XX:AOTCacheOutput.
      
      Impact: Low

      Note that the JVM must be started in AOT training mode using command-line arguments such as -XX:AOTMode=record or -XX:AOTCacheOutput=<file>. The results of the AOT training can be an AOT configuration file, an AOT cache file, or both. For details of AOT training, please refer to https://openjdk.org/jeps/483 and https://openjdk.org/jeps/514

            macarte Mat Carter
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: