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

Default NewRatio is ignored when UseConcMarkSweepGC is used as GC algorithm

XMLWordPrintable

    • gc
    • 8
    • generic
    • generic

      FULL PRODUCT VERSION :
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      Linux host 3.10.0-229.el7.x86_64 #1 SMP Fri Mar 6 11:36:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      When we run
      java -server -Xms6144m -Xmx6144m -XX:MaxMetaspaceSize=256m -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -version

      The par new genearation heap is set to 166MB instead of 1.8GB.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run :
      java -server -Xms6144m -Xmx6144m -XX:MaxMetaspaceSize=256m -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -version

      Check size of Heap of par new generation

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      If the Xms and Xmx is 6GB, par new generation total should be 1887488K instead of 153344K,
      ACTUAL -
      In Sun JDK there were few bugs previously with subject “JDK-6872335 : NewRatio ignored when UseConcMarkSweepGC set”.

      http://bugs.java.com/view_bug.do?bug_id=6872335
      http://bugs.java.com/view_bug.do?bug_id=6862534

      Although these bugs are fixed, but IMO the bug still exists for default settings of NewRatio when UseConcMarkSweepGC is used.


      We still have the bug where the default NewRatio=2 is not considered along with UseConcMarkSweepGC

      Option #1 : Default GC (-XX:+UseParallelGC) : PSYoungGen total 1835008K = 1.75GB (As it considered the default NewRatio=2)
       /usr/bin/java -server -Xms6144m -Xmx6144m -XX:MaxMetaspaceSize=256m -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -version
      -XX:InitialHeapSize=6442450944 -XX:MaxHeapSize=6442450944 -XX:MaxMetaspaceSize=268435456 -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseParallelGC
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
      Heap
      PSYoungGen total 1835008K, used 94372K [0x0000000740000000, 0x00000007c0000000, 0x00000007c0000000)
        eden space 1572864K, 6% used [0x0000000740000000,0x0000000745c29180,0x00000007a0000000)
        from space 262144K, 0% used [0x00000007b0000000,0x00000007b0000000,0x00000007c0000000)
        to space 262144K, 0% used [0x00000007a0000000,0x00000007a0000000,0x00000007b0000000)
      ParOldGen total 4194304K, used 0K [0x0000000640000000, 0x0000000740000000, 0x0000000740000000)
        object space 4194304K, 0% used [0x0000000640000000,0x0000000640000000,0x0000000740000000)
      Metaspace used 2189K, capacity 4480K, committed 4480K, reserved 1056768K
        class space used 240K, capacity 384K, committed 384K, reserved 1048576K


      Option #2 : UseConcMarkSweepGC only (-XX:+ UseConcMarkSweepGC) : par new generation total 153344K = 149.75 MB (Here –XX:NewRatio=2 is ignored which is set by default)

       /usr/bin/java -server -Xms6144m -Xmx6144m -XX:MaxMetaspaceSize=256m -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -version
      -XX:InitialHeapSize=6442450944 -XX:MaxHeapSize=6442450944 -XX:MaxMetaspaceSize=268435456 -XX:MaxNewSize=174485504 -XX:MaxTenuringThreshold=6 -XX:NewSize=174485504 -XX:OldPLABSize=16 -XX:OldSize=348971008 -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
      Heap
      par new generation total 153344K, used 8179K [0x0000000640000000, 0x000000064a660000, 0x000000064a660000)
        eden space 136320K, 6% used [0x0000000640000000, 0x00000006407fcf00, 0x0000000648520000)
        from space 17024K, 0% used [0x0000000648520000, 0x0000000648520000, 0x00000006495c0000)
        to space 17024K, 0% used [0x00000006495c0000, 0x00000006495c0000, 0x000000064a660000)
      concurrent mark-sweep generation total 6121088K, used 0K [0x000000064a660000, 0x00000007c0000000, 0x00000007c0000000)
      Metaspace used 2190K, capacity 4480K, committed 4480K, reserved 1056768K
        class space used 240K, capacity 384K, committed 384K, reserved 1048576K


      Option #3 : UseConcMarkSweepGC along with NewRatio=2 (-XX:+ UseConcMarkSweepGC –XX:NewRatio=2) : par new generation total 1887488K = 1.8 GB (Here –XX:NewRatio=2 is considered when set explicitly)

       /usr/bin/java -server -Xms6144m -Xmx6144m -XX:MaxMetaspaceSize=256m -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseConcMarkSweepGC -XX:NewRatio=2 -version
      -XX:InitialHeapSize=6442450944 -XX:MaxHeapSize=6442450944 -XX:MaxMetaspaceSize=268435456 -XX:MaxTenuringThreshold=6 -XX:NewRatio=2 -XX:OldPLABSize=16 -XX:+PrintCommandLineFlags -XX:+PrintGCDetails -XX:+UseCompressedClassPointers -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC
      java version "1.8.0_60"
      Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
      Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
      Heap
      par new generation total 1887488K, used 100669K [0x0000000640000000, 0x00000006c0000000, 0x00000006c0000000)
        eden space 1677824K, 6% used [0x0000000640000000, 0x000000064624f7f0, 0x00000006a6680000)
        from space 209664K, 0% used [0x00000006a6680000, 0x00000006a6680000, 0x00000006b3340000)
        to space 209664K, 0% used [0x00000006b3340000, 0x00000006b3340000, 0x00000006c0000000)
      concurrent mark-sweep generation total 4194304K, used 0K [0x00000006c0000000, 0x00000007c0000000, 0x00000007c0000000)
      Metaspace used 2189K, capacity 4480K, committed 4480K, reserved 1056768K
        class space used 240K, capacity 384K, committed 384K, reserved 1048576K


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      To set -XX:NewRatio=2 explicitly if we are using -XX:+UseConcMarkSweepGC

            jprovino Joseph Provino (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: