RFR: 8170067: -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses is not implemented for G1

Kim Barrett kim.barrett at oracle.com
Wed Nov 23 19:26:49 UTC 2016

> On Nov 23, 2016, at 8:05 AM, Erik Helin <erik.helin at oracle.com> wrote:
> I just added support for -XX:ExplicitGCInvokesConcurrentAndUnloadsClasses in G1. Since G1 already unloads classes after a concurrent mark by default, I just made -XX:+ExplicitGCInvokesConcurrentAndUnloadsClasses enable -XX:+ExplicitGCInvokesConcurrent. I also added a constraint function to check for some bad flag combinations and a corresponding test.
> Bug:
> https://bugs.openjdk.java.net/browse/JDK-8170067
> Webrev:
> http://cr.openjdk.java.net/~ehelin/8170067/00/

 283   if (UseG1GC && value) {
 284     if (FLAG_IS_CMDLINE(ExplicitGCInvokesConcurrent) && !ExplicitGCInvokesConcurrent) {

ExplicitGCInvokesConcurrent isn't G1-only; it also applies to CMS.
It seems as if CMS should have already had this consistency check, but
doesn't, so far as I could find.

 282 Flag::Error ExplicitGCConcAndUnloadConstraintFunc(bool value, bool verbose) {

It seems like CLA of -XX:-ExplicitGCInvokesConcurrentAndUnloadsClasses
should have some interaction or checking, e.g. if G1 and that flag is
CLA-false but ExplicitGCInvokesConcurrent and
ClassUnloadingWithConcurrentMark are both true, maybe that should be a
constraint violation?


More information about the hotspot-gc-dev mailing list