Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8200729

Conditional compilation of GCs


    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:


      Today we can select two sets of GCs to include in HotSpot builds:
      1) Only the Serial GC - used by the Minimal VM
      2) All GCs - today this means Serial, Parallel, CMS, G1

      As we are developing new GCs (ZGC and Shenandoah), and deprecating old GCs (CMS), it might be useful to select the GCs to compile into a build of HotSpot.

      The RFE proposes that all occurrences of INCLUDE_ALL_GCS get replaced by either of INCLUDE_CMSGC, INCLUDE_G1GC, INCLUDE_PARALLELGC, and/or INCLUDE_SERIALGC, depending on what's appropriate for the code in question.

      Our configure scripts will be changed to allow the flags --enable-cmsgc, --enable-g1gc, --enable-parallelgc, --enable-serialgc.

      Some examples:

      Compile with only G1:
      --enable-cmsgc=no --enable-g1gc=yes --enable-parallelgc=no --enable-serialgc=no.

      Stop compiling with CMS:

      This compiles out PSMarkSweep
      --enable-parallelgc=yes --enable-serialgc=no

      This gets a configure error since CMS requires Serial:
      --enable-cmsgc=yes --enable-serialgc=no

      Note this RFE is somewhat related to the recent cleanups that has been going on in both the 'JDK-8163329 - JEP 304: Garbage Collector Interface' JEP, and as separate RFEs. All that work, and future work in this area, is going to help use minimize the usages of #if INCLUDE_<GC>.

      A prototype for this can be found at:

      Currently, this patch contains the configure and INCLUDE_<GC> changes, plus work to move CG specific code out from non-GC code into the GC specific directories. As much as possible of the work to move code to GC specific files should be pushed as separate RFEs, but they help show where the direction I want to take the code.


          Issue Links



              • Assignee:
                stefank Stefan Karlsson
                stefank Stefan Karlsson
              • Votes:
                0 Vote for this issue
                3 Start watching this issue


                • Created: