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

Fail immediately if an unavailable GC is selected

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
      gc
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      low
    • Compatibility Risk Description:
      This change should only affect existing users of minimal VM, which explicitly specifies a GC other than SerialGC on the command line. All other GCs have historically always been included in non-minimal VMs.
    • Interface Kind:
      add/remove/modify command line option
    • Scope:
      Implementation

      Description

      Summary

      To avoid unexpected behavior, fail immediately if an unavailable GC is selected by the user on the command line.

      Problem

      If an unavailable GC (e.g. the G1 GC is not present in "minimal" VM builds) is selected by the user on the command line, then the VM issues a warning and continues execution by silently selecting a different/available GC. It's easy to miss the warning and this behavior is bound to cause unnecessary confusion. I propose that we instead fail immediately with an appropriate error message.

      This has not been a very big problem so far (essentially only affecting minimal VMs). However, we've recently made it possible to configure which GCs to included/exclude in a VM (using the --with-jvm-features=cmsgc/epsilongc/g1gc/parallelgc/serialgc/zgc option). Some of these GCs are also "experimental" and some vendors might choose to build them and some might choose not to. As a result, it might become more common to see VMs with different sets of supported GCs built in.

      Solution

      Instead of silently selecting one of the available GCs, fail immediately with an appropriate error message. E.g. "Option -XX:+UseG1GC not supported".

      Specification

      I'm essentially suggesting changing a call to:

      warning("....");

      to instead be a call to:

      vm_exit_during_initialization(".....");.

      Webrev: http://cr.openjdk.java.net/~pliden/8205064/webrev.1/

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pliden Per Liden (Inactive)
              Reporter:
              pliden Per Liden (Inactive)
              Reviewed By:
              Aleksey Shipilev, Erik Helin
              Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: