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

Large Pages fails when allocating 8GB+ on Windows/Java 19

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • None
    • 19.0.1, 21.0.1
    • hotspot
    • gc
    • x86
    • windows

      Originally reported at: https://github.com/adoptium/adoptium-support/issues/626

      ------

      ### Please provide a brief summary of the bug

      The title sums it up. It only happens in the Java 19 Adoptium build, not the Java 17 one.

      ### Please provide steps to reproduce where possible

      Enter the commands as seen in the cmd output below. Note the "failed to reserve and commit memory" error:

      ```
      F:\JDKs\jdk-19.0.1+10-jre\bin>java -Xms8G -Xmx8G -XX:+UseLargePages -Xlog:gc+init --version
      [0.027s][info][gc,init] CardTable entry size: 512
      OpenJDK 64-Bit Server VM warning: Failed to reserve and commit memory using large pages. req_addr: 0x0000000600000000 bytes: 8589934592
      [0.231s][info][gc,init] Version: 19.0.1+10 (release)
      [0.231s][info][gc,init] CPUs: 16 total, 16 available
      [0.231s][info][gc,init] Memory: 15789M
      [0.232s][info][gc,init] Large Page Support: Enabled
      [0.232s][info][gc,init] NUMA Support: Disabled
      [0.232s][info][gc,init] Compressed Oops: Enabled (Zero based)
      [0.232s][info][gc,init] Heap Region Size: 4M
      [0.233s][info][gc,init] Heap Min Capacity: 8G
      [0.233s][info][gc,init] Heap Initial Capacity: 8G
      [0.233s][info][gc,init] Heap Max Capacity: 8G
      [0.233s][info][gc,init] Pre-touch: Disabled
      [0.233s][info][gc,init] Parallel Workers: 13
      [0.233s][info][gc,init] Concurrent Workers: 3
      [0.233s][info][gc,init] Concurrent Refinement Workers: 13
      [0.233s][info][gc,init] Periodic GC: Disabled
      openjdk 19.0.1 2022-10-18
      OpenJDK Runtime Environment Temurin-19.0.1+10 (build 19.0.1+10)
      OpenJDK 64-Bit Server VM Temurin-19.0.1+10 (build 19.0.1+10, mixed mode, sharing)

      F:\JDKs\jdk-19.0.1+10-jre\bin>java -Xms7G -Xmx7G -XX:+UseLargePages -Xlog:gc+init --version
      [0.007s][info][gc,init] CardTable entry size: 512
      [0.014s][info][gc,init] Version: 19.0.1+10 (release)
      [0.015s][info][gc,init] CPUs: 16 total, 16 available
      [0.016s][info][gc,init] Memory: 15789M
      [0.016s][info][gc,init] Large Page Support: Enabled
      [0.017s][info][gc,init] NUMA Support: Disabled
      [0.017s][info][gc,init] Compressed Oops: Enabled (Zero based)
      [0.018s][info][gc,init] Heap Region Size: 4M
      [0.018s][info][gc,init] Heap Min Capacity: 7G
      [0.018s][info][gc,init] Heap Initial Capacity: 7G
      [0.018s][info][gc,init] Heap Max Capacity: 7G
      [0.019s][info][gc,init] Pre-touch: Disabled
      [0.019s][info][gc,init] Parallel Workers: 13
      [0.019s][info][gc,init] Concurrent Workers: 3
      [0.019s][info][gc,init] Concurrent Refinement Workers: 13
      [0.020s][info][gc,init] Periodic GC: Disabled
      openjdk 19.0.1 2022-10-18
      OpenJDK Runtime Environment Temurin-19.0.1+10 (build 19.0.1+10)
      OpenJDK 64-Bit Server VM Temurin-19.0.1+10 (build 19.0.1+10, mixed mode, sharing)

      F:\JDKs\jdk-19.0.1+10-jre\bin>"C:\JDKs\OpenJDK17U-jre_x64_windows_hotspot_17.0.4_8\jdk-17.0.4+8-jre\bin\java.exe" -Xms8G -Xmx8G -XX:+UseLargePages -Xlog:gc+init --version
      [0.394s][info][gc,init] Version: 17.0.4+8 (release)
      [0.395s][info][gc,init] CPUs: 16 total, 16 available
      [0.395s][info][gc,init] Memory: 15789M
      [0.395s][info][gc,init] Large Page Support: Enabled
      [0.396s][info][gc,init] NUMA Support: Disabled
      [0.396s][info][gc,init] Compressed Oops: Enabled (Zero based)
      [0.396s][info][gc,init] Heap Region Size: 4M
      [0.397s][info][gc,init] Heap Min Capacity: 8G
      [0.397s][info][gc,init] Heap Initial Capacity: 8G
      [0.397s][info][gc,init] Heap Max Capacity: 8G
      [0.397s][info][gc,init] Pre-touch: Disabled
      [0.398s][info][gc,init] Parallel Workers: 13
      [0.398s][info][gc,init] Concurrent Workers: 3
      [0.398s][info][gc,init] Concurrent Refinement Workers: 13
      [0.398s][info][gc,init] Periodic GC: Disabled
      openjdk 17.0.4 2022-07-19
      OpenJDK Runtime Environment Temurin-17.0.4+8 (build 17.0.4+8)
      OpenJDK 64-Bit Server VM Temurin-17.0.4+8 (build 17.0.4+8, mixed mode, sharing)
      ```

      ### Expected Results

      Large pages works.

      ### Actual Results

      Large pages does not work, even when just running "java -version" from the cmd window.

      ### What Java Version are you using?

      19.0.1+10 (release)

      ### What is your operating system and platform?

      Windows 10 21H2 on x86-64

      Ryzen 4900HS CPU, 16GB of RAM.

      ![Capture](https://user-images.githubusercontent.com/8422224/200199689-48908cff-34c2-4608-a1a7-c1a5faa1660b.PNG)

      Another user on another machine also experiences this issue.

      ### How did you install Java?

      Via a zip download from the Adoptium site.

      ### Did it work before?

      Yes, in Java 17.



      ### Did you test with other Java versions?


      I also tested this in GraalVM EE ('19.0.1+10-jvmci-22.3-b07'. It does appear to be an upstream bug, but I am not 100% sure:
      ```
      F:\JDKs\graalvm-ee-java19-22.3.0\bin>java -Xms8G -Xmx8G -XX:+UseLargePages -Xlog:gc+init --version
      [0.007s][info][gc,init] CardTable entry size: 512
      Java HotSpot(TM) 64-Bit Server VM warning: Failed to reserve and commit memory using large pages. req_addr: 0x0000000600000000 bytes: 8589934592
      [0.161s][info][gc,init] Version: 19.0.1+10-jvmci-22.3-b07 (release)
      [0.161s][info][gc,init] CPUs: 16 total, 16 available
      [0.161s][info][gc,init] Memory: 15789M
      [0.161s][info][gc,init] Large Page Support: Enabled
      [0.162s][info][gc,init] NUMA Support: Disabled
      [0.162s][info][gc,init] Compressed Oops: Enabled (Zero based)
      [0.163s][info][gc,init] Heap Region Size: 4M
      [0.163s][info][gc,init] Heap Min Capacity: 8G
      [0.163s][info][gc,init] Heap Initial Capacity: 8G
      [0.164s][info][gc,init] Heap Max Capacity: 8G
      [0.164s][info][gc,init] Pre-touch: Disabled
      [0.164s][info][gc,init] Parallel Workers: 13
      [0.165s][info][gc,init] Concurrent Workers: 3
      [0.165s][info][gc,init] Concurrent Refinement Workers: 13
      [0.165s][info][gc,init] Periodic GC: Disabled
      java 19.0.1 2022-10-18
      Java(TM) SE Runtime Environment GraalVM EE 22.3.0 (build 19.0.1+10-jvmci-22.3-b07)
      Java HotSpot(TM) 64-Bit Server VM GraalVM EE 22.3.0 (build 19.0.1+10-jvmci-22.3-b07, mixed mode, sharing)
      ```


      ### Relevant log output


      (See repro steps section)

            karianna Martijn Verburg
            karianna Martijn Verburg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: