JDK-8271197 : When out of large pages, GCs allocate small pages with large page alignment
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 17
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2021-07-23
  • Updated: 2024-05-24
  • Resolved: 2024-05-24
Related Reports
Relates :  
Description
Consider this case:

Required Heap size : 2GB
Explicit 1GB large page reserved in hugetlbfs : 2 (2GB)
Explicit 2MB large page reserved in hugetlbfs : 0

In this case heap is allocated two 1GB pages and all other allocations from 4KB pages but their page alignment is 2M which can result into fragmentation issues.

See the attachment in JDK-8271195 for example output.

Comments
Will close as WNF. It is true that when out of large pages, GC allocation code will reuse the same reservation used for allocating the large pages which is incidentally aligned to large page size. Given that on 64 bit address space is huge anyway, there is little likelihood that there is an issue even with 1G pages. Only on 32 bit the argument could be made that this may prevent VM startup, but it is unlikely to get (multiple) 1G pages on such systems anyway (if it is possible). This issue has been reported almost three years ago without anyone stepping up demonstrating an actual problem. If there is one, reopen the issue.
24-05-2024

We won't get to this in 19.
17-05-2022

Maybe only with hugetlbfs?
23-07-2021