Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8010344 | 8 | Joseph Provino | P3 | Closed | Fixed | b82 |
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.
• 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.
- backported by
-
JDK-8010344 Some adjustments needed to minimal VM warnings and errors for unsupported command line options
- Closed
- relates to
-
JDK-7189254 Change makefiles for more flexibility to override defaults
- Resolved