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

Some adjustments needed to minimal VM warnings and errors for unsupported command line options

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: hs25
    • Fix Version/s: hs25
    • Component/s: embedded
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      b23
    • Verification:
      Verified

      Backports

        Description

        The minimal VM introduced the ability to strip out some VM features from the build. See JDK-7189254. Specifying command line options related to unsupported VM features can produce a warning or an error depending on the feature being used. A decision was made to adjust which give warnings and which give errors based on the following criteria:

         • The strategy for warnings is to produce them when using an option that most likely is not critical to properly running the VM in the manner requested by the user, therefore allowing scripts to continue to run.
         • The strategy for errors is to produce them when most likely the user does not want to run the VM without the feature. If the VM was allowed to run, the user may miss the warning message and may wonder why the VM is not running as expected.
         • We need to be consistent with what non-minimal VM builds do when an option cannot be used (or fails) for some reason.
         
        The choice of warning or error for each VM feature is not always obvious, and there will always be cases where for certain users the wrong choice was made. Thus for each feature we need to 2nd guess what will likely be the least disruptive and most useful choice. Below is are the choices made:
         
        Warnings:
         
         • Unsupported GC options
         • JNI Checker: -Xcheck:jni
         • CDS: -Xshare:auto
         
        Errors:
         
         • Management: -XX:+ManagementServer or -Dcom.sun.management
         • JVMTI: -javaagent:jarpath - Note that currently using -javaagent with a bad jarpath also produces an error.
         • JDWP and JPDA: -Xrunjdwp and -agentlib:jdwp
         • HPROF: -agentlib:hprof or -Xrunhprof
         • NMT: -XX:NativeMemoryTracking
         • Flat Profiler: -Xprof
         • CDS: -Xshare:on and -Xshare:dump - Note that this is consistent with what these options do for non-minimal VM builds do when they fail for some reason.

        Just to be clear, the list of features in the Errors section are not necessarily needed to properly run a java application. However, if the user specifies them, they are likely depending on the feature in order to run the application in the manner requested, such as wanting to debug with JVMTI or get profiling related data.

        Based on the above, and what the minimal VM is currently doing for these options, the following adjustments are needed:

        Change from Warning to Error:
         • JVMTI: -javaagent:jarpath - Note that currently using -javaagent with a bad jarpath also produces an error.
         • JDWP and JPDA: -Xrunjdwp and -agentlib:jdwp
         • HPROF: -agentlib:hprof or -Xrunhprof
         • NMT: -XX:NativeMemoryTracking
         • Flat Profiler: -Xprof

        Fix CDS -Xshare:
         • -Xshare:dump - Currently produces an error, which is what we want.
         • -Xshare:on - Currently has no check. Need to add check and produce a error.
         • -Xshare:off - Currently has no check. This is ok. No need for warning or error.
         • -Xshare:auto - Currently has no check. Need to add check and produce a warning.

        Related to this, there are a number of CDS globals that are settable on the command line, and are also set based on the use of -Xshare. They also need to produce warnings/errors when used. They include:

         • UseSharedSpaces: Should produce a warning if set true.
         • RequireSharedSpaces: Should produce an error if set true.
         • DumpSharedSpaces: Should produce an error if set true.
         • PrintSharedSpaces: Should produce a warning if set true.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jprovino Joseph Provino (Inactive)
                Reporter:
                cjplummer Chris Plummer
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: