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

Make -Xshare:auto the default for server VM

XMLWordPrintable

    • b11

      We expect CDS to be widely used with the Server VM. However, the current default CDS setting for Server VM is -Xshare:off. This makes it cumbersome to use CDS.

      We should change the default to -Xshare:auto, so as long as a CDS archive exists in the JDK, CDS will be automatically used without specifying extra flags.

      In JDK 8 and before, RewriteBytecodes was disabled when CDS was enabled. This caused performance degradation in the Server Compiler (aka C2). However this has been fixed in JDK-8074345 since JDK 9, so there's no longer need to disable CDS by default with the Server VM.

      The proposed change is to remove this block of code
      http://hg.openjdk.java.net/jdk/hs/file/eebf559c9e0d/src/hotspot/share/runtime/arguments.cpp#l1819

      #if COMPILER2_OR_JVMCI
        // Shared spaces work fine with other GCs but causes bytecode rewriting
        // to be disabled, which hurts interpreter performance and decreases
        // server performance. When -server is specified, keep the default off
        // unless it is asked for. Future work: either add bytecode rewriting
        // at link time, or rewrite bytecodes in non-shared methods.
        if (is_server_compilation_mode_vm() && !DumpSharedSpaces && !RequireSharedSpaces &&
            (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
          no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on.");
        }
      #endif

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

              Created:
              Updated:
              Resolved: