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

Fix range of flag MaxDirectMemorySize which is parsed at jlong.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 9
    • 9
    • hotspot
    • None
    • b120

      MaxDirectMemorySize is used to set property sun.nio.MaxDirectMemorySize. In the end, the value is parsed into a Java long. The upper bound of the flag is max_size_t, which can not be represented as Java long properly.

      bin/java -XX:MaxDirectMemorySize=18446744073709551615
      Error occurred during initialization of VM
      java.lang.NumberFormatException: For input string: "18446744073709551615"
              at java.lang.NumberFormatException.forInputString(java.base/NumberFormatException.java:65)
              at java.lang.Long.parseLong(java.base/Long.java:747)
              at java.lang.Long.parseLong(java.base/Long.java:872)
              at jdk.internal.misc.VM.saveAndRemoveProperties(java.base/VM.java:290)
              at java.lang.System.initPhase1(java.base/System.java:1865)

            gziemski Gerard Ziemski
            goetz Goetz Lindenmaier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: