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

Issue with setting the -Xmax close to maximum heap size allocated

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 8, 9
    • hotspot
    • generic
    • generic

      Verified on 32 bit, it may be holds good for 64bit as well. does not show up on HeapSize options
      ==
      Case1: Setting with 1GB no issues
      -sh-4.1$ /opt/java/32/jdk-9/bin/java -Xmx1g -XX:+PrintFlagsFinal -version | grep HeapSize
         size_t ErgoHeapSizeLimit = 0 {product}
         size_t HeapSizePerGCThread = 67108864 {product}
         size_t InitialHeapSize := 67108864 {product}
         size_t LargePageHeapSizeThreshold = 134217728 {product}
         size_t MaxHeapSize := 1073741824 {product}
          uintx NonNMethodCodeHeapSize := 5541734 {pd product}
          uintx NonProfiledCodeHeapSize := 123058253 {pd product}
          uintx ProfiledCodeHeapSize := 123058253 {pd product}
      java version "9-ea"
      Java(TM) SE Runtime Environment (build 9-ea+127)
      Java HotSpot(TM) Server VM (build 9-ea+127, mixed mode)

      Cas2: Setting maximum than the allowed size
      -sh-4.1$ /opt/java/32/jdk-9/bin/java -Xmx4g -XX:+PrintFlagsFinal -version | grep HeapSize
      Invalid maximum heap size: -Xmx4g
      The specified size exceeds the maximum representable size.
      Error: Could not create the Java Virtual Machine.
      Error: A fatal exception has occurred. Program will exit.

      Issue when tried to set close to maximum heap allocated (4GB on 32 bit machine)
      Case3:
      -sh-4.1$ /opt/java/32/jdk-9/bin/java -Xmx3g -XX:+PrintFlagsFinal -version | grep HeapSize
      -sh-4.1$

      Prompt returns without showing HeapSize options

            Unassigned Unassigned
            fmatte Fairoz Matte
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: