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

-XX:AOTMode=record interferes with application execution

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 25
    • 25
    • hotspot
    • b15

      Since JDK-8348426, If -XX:AOTMode=record is specified in the command-line, the application's behavior is affected in the following 2 ways:

      [1] The application is not able to launch new Threads. The fix is:

      --- a/src/hotspot/share/cds/cdsConfig.cpp
      +++ b/src/hotspot/share/cds/cdsConfig.cpp
      @@ -561,7 +561,7 @@ bool CDSConfig::is_dumping_final_static_archive() {
       
       bool CDSConfig::allow_only_single_java_thread() {
         // See comments in JVM_StartThread()
      - return is_dumping_static_archive();
      + return is_dumping_classic_static_archive() || is_dumping_final_static_archive();
       }
       
      [2] The exit code is ignored and becomes zero. The fix is:

      index ee877c474b9..3658a28c102 100644
      --- a/src/hotspot/share/cds/metaspaceShared.cpp
      +++ b/src/hotspot/share/cds/metaspaceShared.cpp
      @@ -823,8 +823,10 @@ void MetaspaceShared::preload_and_dump(TRAPS) {
       
         if (CDSConfig::new_aot_flags_used()) {
           if (CDSConfig::is_dumping_preimage_static_archive()) {
      + // We are in the JVM that runs the training run. Continue execution,
      + // so that it can finish all clean-up and return the correct exit
      + // code to the OS.
             tty->print_cr("AOTConfiguration recorded: %s", AOTConfiguration);
      - vm_exit(0);
           } else {

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: