RFR: 8253412: Unsupported GC options passed in JAVA_TOOL_OPTIONS are silently ignored
Aleksey Shipilev
shade at openjdk.java.net
Mon Sep 21 10:14:09 UTC 2020
See the reproducer in the bug itself. I think that happens because GCConfig checks only for FLAG_IS_CMDLINE, which is
only from cmdline-originated flags. In this case, the flag comes from the environment variable. Maybe checking for
`!FLAG_IS_DEFAULT` is better, as it captures all non-default origins.
But them, instead of checking for `FLAG_IS_CMDLINE`, I think we can rely on the fact that all `Use*GC` options are
`false` by default. So if any of such flags is `true`, it means something had selected the GC. This allows for some
further simplification of the macro (although I am not sure if it was intended to be ever used to check `-XX:-*` flags).
Attention @pliden.
Testing:
- [x] Ad-hoc reproducer now passes
- [ ] Linux x86_64 fastdebug tier1
-------------
Commit messages:
- Drop flag override checking completely: all Use*GC flags are "false" by default
- 8253412: Unsupported GC options passed in JAVA_TOOL_OPTIONS are silently ignored
Changes: https://git.openjdk.java.net/jdk/pull/282/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=282&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8253412
Stats: 11 lines in 1 file changed: 0 ins; 2 del; 9 mod
Patch: https://git.openjdk.java.net/jdk/pull/282.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/282/head:pull/282
PR: https://git.openjdk.java.net/jdk/pull/282
More information about the hotspot-gc-dev
mailing list