JDK-8259496 : Parallel GC insists on using large pages although it failed to use them
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 17
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2021-01-08
  • Updated: 2022-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 20
20Unresolved
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
This huge page setup:
$ cat hugepages-1048576kB/free_hugepages 30
$ cat hugepages-2048kb/free_hugepages 0

$ java -Xmx20g -Xms20g -XX:+UseLargePages -XX:LargePageSizeInBytes=1g -XX:+PrintFlagsFinal -XX:+AlwaysPreTouch -XX:+UseParallelGC Hello

OpenJDK 64-Bit Server VM warning: Failed to reserve shared memory. (error = 1)
[1.667s][warning][gc] Pretouch size 4294967296 chunk size 1073741824 page size 1073741824
[1.668s][warning][gc] Pretouch size 1073741824 chunk size 1073741824 page size 1073741824
[1.668s][warning][gc] Pretouch size 1073741824 chunk size 1073741824 page size 1073741824
[5.526s][warning][gc] Pretouch size 15032385536 chunk size 1073741824 page size 1073741824

Parallel gc fails on allocating 1g pages here, but still pre-touches with 1g page size.


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

Unassigning for now. As already mentioned the page size passed to the pre-touching doesn't check if the underlying resevation was successfully using large pages. The fix should probably be to extend MutableSpace and PSVirtualSpace to keep track of the page size actually used for the underlying ReservedSpace and pass this to the pre-touch task.
09-06-2021

In MutableSpace::initialize() the page sized passed to the PretouchTask is only considering the UseLargePages flag. It should also look at the underlying ReservedSpace to get the real page size. I'm currently doing work in this area and hopefully it will be a bit easier soon to get the correct page size. I'm assigning this to me for now and will hopefully handle it fairly soon.
08-02-2021