RFR: 8372150: Parallel: Tighten requirements around MinHeapSize with NUMA and Large Pages [v2]
Albert Mingkun Yang
ayang at openjdk.org
Thu Nov 20 11:38:47 UTC 2025
On Wed, 19 Nov 2025 17:37:56 GMT, Joel Sikström <jsikstro at openjdk.org> wrote:
>> Hello,
>>
>> Today, Parallel decides to opt out of using Large pages if the heap size, either minimum, initial or maximum, does not cover enough Large pages for all spaces. Additionally, if we don't get enough heap size for at least one OS page per MutableNUMASpace (one per NUMA-node), Parallel decides to run in a NUMA-degraded mode, where it skips allocating memory locally for some NUMA-nodes. Both of these issues are problematic if we want to start the JVM with a default initial heap size that is equal to the minimum heap size (see JDK-8371986). To solve this, we should consider making sure that the minimum heap size is always enough to cover precisely one page per space, where the page size may be Large or not. By making sure the minimum heap size covers this, we never have to disable Large pages or run in a NUMA-degraded mode based on the settings of minimum, initial or maximum heap sizes.
>>
>> For completeness, when user-provided settings for UseNUMA, UseLargePages and heap sizes can't be satisfied at the same time, one must be prioritised over others. Today, we prioritise heap size settings over both UseNUMA and UseLargePages. This change suggest shifting the priority to UseNUMA and UseLargePages, by bumping MinHeapSize, InitialHeapSize and MaxHeapSize to an adequate number, if not already enough. By bumping the minimum heap size to an adequate number, we are also bumping the lower-limit for the Initial heap size and maximum heap size, which must be equal to or greater than the minimum heap size.
>>
>> <details>
>>
>> <summary><b>Min and Initial heap sizes before/after</b> (expandable section)</summary>
>>
>> Before changes. We always get Min&Initial 2MB that we request:
>>
>> java -XX:+UseParallelGC -Xms2M -Xmx1G
>> Alignments: Space 512K, Heap 2M
>> Heap Min Capacity: 2M
>> Heap Initial Capacity: 2M
>>
>> java -XX:+UseParallelGC -XX:+UseLargePages -Xms2M -Xmx1G
>> MinHeapSize (2097152) must be large enough for 4 * page-size; Disabling UseLargePages for heap
>> Alignments: Space 512K, Heap 2M
>> Heap Min Capacity: 2M
>> Heap Initial Capacity: 2M
>>
>> java -XX:+UseParallelGC -XX:+UseNUMA -Xms2M -Xmx1G
>> Alignments: Space 512K, Heap 2M
>> Heap Min Capacity: 2M
>> Heap Initial Capacity: 2M
>>
>> java -XX:+UseParallelGC -XX:+UseLargePages -XX:+UseNUMA -Xms2M -Xmx1G
>> MinHeapSize (2097152) must be large enough for 4 * page-size; Disabling UseLargePages for heap
>> Alignments: Space 512K, Heap 2M
>> Heap Min Capacity: 2M
>> Heap Initial Capacity: 2M
>>
>>
>> After changes...
>
> Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:
>
> Albert review feedback
Marked as reviewed by ayang (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/28394#pullrequestreview-3487336157
More information about the hotspot-gc-dev
mailing list