<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    Hi Peter,<br>
    <br>
    This is a known issue [1], and we found the problem a bit to late
    for the fix to be included in the initial release of JDK 25. See the
    JBS issue [2] for more details.<br>
    <br>
    The fix for the problem is scheduled to be released in JDK 25.0.2.
    The workaround (which is not optimal) is to configure the THP mode
    to 'always' in:<br>
    /sys/kernel/mm/transparent_hugepage/enabled<br>
    <br>
    This will make the heap be backed by transparent huge pages. When
    configured as 'always' you don't need the
    -XX:+UseTransparentHugePages flag. The logs won't reflect the actual
    page size used if I'm not mistaken, but you can use OS tools to
    verify that transparent huge pages are used for the heap.<br>
    <br>
    Hope this helps,<br>
    Stefan<br>
    <br>
    [1]
    <a class="moz-txt-link-freetext" href="https://www.oracle.com/java/technologies/javase/25-relnote-issues.html">https://www.oracle.com/java/technologies/javase/25-relnote-issues.html</a><br>
    [2] <a class="moz-txt-link-freetext" href="https://bugs.openjdk.org/browse/JDK-8366434">https://bugs.openjdk.org/browse/JDK-8366434</a><br>
    <br>
    <div class="moz-cite-prefix">On 2025-11-03 21:55, Peter Kessler OS
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:C1F04C5E-792E-4A24-8836-AA5591C144BE@os.amperecomputing.com">
      
      <meta name="Generator" content="Microsoft Word 15 (filtered medium)">
      <style>@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;
        mso-ligatures:standardcontextual;}span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Aptos",sans-serif;
        color:windowtext;}.MsoChpDefault
        {mso-style-type:export-only;}div.WordSection1
        {page:WordSection1;}</style>
      <div class="WordSection1">
        <p class="MsoNormal"><span style="font-size:11.0pt">Between
            JDK-24 (24.0.2+12-54, dba 24.0.2) and JDK-25 (25.0.1+8-27,
            dba 25.0.1), running an application on a machine with 64KiB
            system page size and 512MiB transparent huge pages, I see
            this difference:<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">$
            "${OPENJDK_DIR}"/jdk-24.0.2/bin/java -showversion
            <span style="background:yellow;mso-highlight:yellow">-XX:+UseTransparentHugePages</span>
            -Xmx12g -Xms12g -Xlog:pagesize=info HelloWorld<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Explicit hugepage support:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            hugepage size: 2M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            hugepage size: 512M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            hugepage size: 16G<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            default hugepage size: 512M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Transparent hugepage (THP) support:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            THP mode: always<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            THP pagesize: 512M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Shared memory transparent hugepage (THP) support:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            Shared memory THP mode: never<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            JVM will attempt to prevent THPs in thread stacks.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            UseLargePages=1, UseTransparentHugePages=1<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Large page support enabled. Usable page sizes: 64k, 512M.
            Default large page size: 512M.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.002s][info][pagesize]
            CodeHeap 'profiled nmethods':  min=2496K max=118272K
            base=0x00004000108d0000 size=118272K page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.002s][info][pagesize]
            CodeHeap 'non-nmethods':  min=2496K max=9152K
            base=0x0000400017c50000 size=9152K page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.002s][info][pagesize]
            CodeHeap 'non-profiled nmethods':  min=2496K max=118336K
            base=0x0000400018540000 size=118336K page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Heap:  min=12G max=12G base=0x0000000500000000 size=12G
            <span style="background:yellow;mso-highlight:yellow">page_size=512M</span><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Block Offset Table: req_size=24M req_page_size=64K
            base=0x0000400024440000 size=24M page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Card Table: req_size=24M req_page_size=64K
            base=0x0000400025c40000 size=24M page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Mark Bitmap: req_size=192M req_page_size=64K
            base=0x0000400027440000 size=192M page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">openjdk
            version "24.0.2" 2025-07-15<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">OpenJDK
            Runtime Environment (build 24.0.2+12-54)<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">OpenJDK
            64-Bit Server VM (build 24.0.2+12-54, mixed mode, sharing)<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">Hello
            world!<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">versus<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">$
            "${OPENJDK_DIR}"/jdk-25.0.1/bin/java -showversion
            <span style="background:yellow;mso-highlight:yellow">-XX:+UseTransparentHugePages</span>
            -Xmx12g -Xms12g -Xlog:pagesize=info HelloWorld<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Explicit hugepage support:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            hugepage size: 2M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            hugepage size: 512M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            hugepage size: 16G<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            default hugepage size: 512M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Transparent hugepage (THP) support:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            THP mode: always<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            THP pagesize: 512M<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Shared memory transparent hugepage (THP) support:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]  
            Shared memory THP mode: never<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            JVM will attempt to prevent THPs in thread stacks.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            UseLargePages=1, UseTransparentHugePages=1<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.001s][info][pagesize]
            Large page support enabled. Usable page sizes: 64k, 512M.
            Default large page size: 512M.<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.002s][info][pagesize]
            CodeHeap 'profiled nmethods':  min=2496K max=118272K
            base=0x00004000108d0000 size=118272K page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.002s][info][pagesize]
            CodeHeap 'non-nmethods':  min=2496K max=9152K
            base=0x0000400017c50000 size=9152K page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.002s][info][pagesize]
            CodeHeap 'non-profiled nmethods':  min=2496K max=118336K
            base=0x0000400018540000 size=118336K page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Heap:  min=12G max=12G base=0x0000000500000000 size=12G
            <span style="background:yellow;mso-highlight:yellow">page_size=64K</span><o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Block Offset Table: req_size=24M req_page_size=64K
            base=0x0000400024550000 size=24M page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Card Table: req_size=24M req_page_size=64K
            base=0x0000400025d50000 size=24M page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">[0.003s][info][pagesize]
            Mark Bitmap: req_size=192M req_page_size=64K
            base=0x0000400027550000 size=192M page_size=64K<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">openjdk
            version "25.0.1" 2025-10-21<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">OpenJDK
            Runtime Environment (build 25.0.1+8-27)<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">OpenJDK
            64-Bit Server VM (build 25.0.1+8-27, mixed mode, sharing)<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin-left:.5in"><span style="font-size:10.0pt;font-family:"Courier New"">Hello
            world!<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">Why am I not
            getting 512MiB pages for my heap in JDK-25, when I was
            getting 512MiB pages for my heap in JDK-24?  Maybe more to
            the point: How do I get transparent huge pages for my heap
            in JDK-25?<o:p></o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt">                                               
            ... peter<o:p></o:p></span></p>
      </div>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre wrap="" class="moz-quote-pre">_______________________________________________
hotspot-gc-use mailing list
<a class="moz-txt-link-abbreviated" href="mailto:hotspot-gc-use@openjdk.org">hotspot-gc-use@openjdk.org</a>
<a class="moz-txt-link-freetext" href="https://mail.openjdk.org/mailman/listinfo/hotspot-gc-use">https://mail.openjdk.org/mailman/listinfo/hotspot-gc-use</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>