IgnoreUnrecognizedVMOptions and badly specified options

Vladimir Kozlov vladimir.kozlov at oracle.com
Thu Jun 25 14:45:47 UTC 2015


It is not intentional but difficult to implement.
It was added to allow specify options which are not defined in running VM.
For example when C2 option is specified but Client VM (which has only C1) is run.
We can do more smarter things here, I agree, by trying to verify options before ignoring it.
But it will not help with misspelled options, I think.

Regards,
Vladimir

On 6/25/15 5:17 AM, Dmitry Dmitriev wrote:
> Hello,
>
> Working with JVM command line options I noticed that "IgnoreUnrecognizedVMOptions" option allow to hide options with bad
> values. "IgnoreUnrecognizedVMOptions" allow to ignore unrecognized options, but it also allow to ignore improperly
> specified VM Options which are processed in general way, i.e. "-XX:" options processed by Arguments::process_argument
> function(hotspot/src/share/vm/runtime/arguments.cpp module).
>
> I will be very appreciated if someone can describe this behavior or state that this is intentional.
>
> Example for numeric and boolean options:
> 1) Bad numeric option with and without "-XX:+IgnoreUnrecongnizedVMOptions"
> java -XX:MaxRAMFraction=-1 -version
> Improperly specified VM option 'MaxRAMFraction=-1'
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit.
>
> java -XX:MaxRAMFraction=-1 -XX:+IgnoreUnrecognizedVMOptions -version
> java version "1.8.0_40"
> Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
> Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
>
> 2) Bad boolean option with and without "-XX:+IgnoreUnrecongnizedVMOptions"
> java -XX:UseG1GC -version
> Missing +/- setting for VM option 'UseG1GC'
> Error: Could not create the Java Virtual Machine.
> Error: A fatal exception has occurred. Program will exit.
>
> java -XX:UseG1GC -XX:+IgnoreUnrecognizedVMOptions -version
> java version "1.8.0_40"
> Java(TM) SE Runtime Environment (build 1.8.0_40-b26)
> Java HotSpot(TM) 64-Bit Server VM (build 25.40-b25, mixed mode)
>
> So, as we see when "-XX:+IgnoreUnrecongnizedVMOptions" is used, bad "-XX:MaxRAMFraction=-1" and "-XX:UseG1GC" are
> ignored. I don't know is this behavior intentional or not, but HotSpot works in that way.
>
> So, can someone tell me this is intentional? Or this behavior is wrong?
>
> Thank you,
> Dmitry
>
>


More information about the hotspot-dev mailing list