RFR (XS) 8209802: JFR failed to build when certain garbage collectors are disabled

Thomas Schatzl thomas.schatzl at oracle.com
Tue Oct 23 11:43:17 UTC 2018


Hi Derek,

On Fri, 2018-10-19 at 15:04 -0700, Derek Thomson wrote:
> Hi all,
> 
> I saw this bug and thought I could take a stab at it. I tweaked the
> #ifs to make it work for -g1gc, then decided to keep going and make
> sure all valid GC exclusions work.
> 
> It's worth noting that you can't say '-serialgc' without also using
> '-cmsgc', as CMS relies on serial.
> 
> Could someone review it please?
> 
> Webrev: http://cr.openjdk.java.net/~jcbeyler/8209802/webrev.00/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8209802

  - wouldn't it be more useful to tweak the makefiles so that setting
-serialgc implies -cmsgc, and conversely, +cmsgc implies +serialgc?

Or, for me as fine, if conflicting options are set, return with an
error.

Because it looks like with this change, with -serialgc +cmsgc you will
get a non-functioning CMS anyway. I.e. generate a nonsensical
situation.

This removes a lot of #ifdef SERIALGC I think.

I am actually not sure it is actually possible to compile (and
succesfully run any of the "old" gcs) without serial gc at the moment.

  - the friend declaration in heapRegion.hpp can be removed instead of
ifdef'ed. G1 does not use these methods. HeapRegion is still a
CompactibleSpace/Space, but it actually should not any more.

(And applying the Serial gc full gc to G1 will crash the VM)

Anyway, for this change, just remove the friend declaration completely.

  - in jfr.cpp, I would prefer the ifdef's completely removed the
TRACE_REQUEST_FUNC(G1HeapRegionInformation), if possible. Otherwise, I
think it is better to remove starting from the body of this method.

  - in jfrType.cpp the question is if compiling without g1 could remove
the entire declaration of G1HeapRegionTypeConstant.

Cc'ing hotspot-jfr-dev at openjdk.java.net as the jfr devs might have an
idea how to accomplish that.

Thanks,
  Thomas




More information about the hotspot-gc-dev mailing list