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

NewSize and MaxNewSize are set ergonomically too small value when NewSize=0

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • gc

      JVM can set NewSize and MaxNewSize ergonomically however these values can be too small when NewSize=0.

      Examples:
      java -XX:+UseSerialGC -XX:NewSize=0 -Xmx50m -Xms30m -XX:+PrintFlagsFinal -version 2>&1 | grep -i "\(max\|initial\)heapsize\|\(max\)\?newsize \|initialization "
         size_t InitialHeapSize := 31457280 {product}
         size_t MaxHeapSize := 52428800 {product}
         size_t MaxNewSize := 17432576 {product}
         size_t NewSize := 196608 {product}
      Error occurred during initialization of VM
      GC triggered before VM initialization completed. Try increasing NewSize, current value 192K.

      java -XX:+UseSerialGC -XX:NewSize=0 -Xmx50m -Xms40m -XX:+PrintFlagsFinal -version 2>&1 | grep -i "\(max\|initial\)heapsize\|\(max\)\?newsize \|initialization "
         size_t InitialHeapSize := 41943040 {product}
         size_t MaxHeapSize := 52428800 {product}
         size_t MaxNewSize := 17432576 {product}
         size_t NewSize := 6946816 {product}

      java -XX:+UseSerialGC -XX:NewSize=0 -Xmx50m -Xms50m -XX:+PrintFlagsFinal -version 2>&1 | grep -i "\(max\|initial\)heapsize\|\(max\)\?newsize \|initialization "
         size_t InitialHeapSize := 52428800 {product}
         size_t MaxHeapSize := 52428800 {product}
         size_t MaxNewSize := 196608 {product}
         size_t NewSize := 196608 {product}
      Error occurred during initialization of VM
      GC triggered before VM initialization completed. Try increasing NewSize, current value 192K.

      It is seen that NewSize and MaxNewSize are set wrong on tested machine.

      Heap sizes:
      -Xmx50m -Xms50m -> NewSize ==192k MaxNewSize == 192k
      -Xmx50m -Xms40m -> NewSize = 6946816 MaxNewSize = 17432576
      -Xmx50m -Xms30m -> NewSize = 192k MaxNewSize = 17432576

      Affected GC - Serial and CMS.

      Issue was found during working on https://bugs.openjdk.java.net/browse/JDK-8161604

            sangheki Sangheon Kim
            mchernov Michail Chernov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: