RFR: 8372150: Parallel: Tighten requirements around MinHeapSize with NUMA and Large Pages [v2]

Joel Sikström jsikstro at openjdk.org
Wed Nov 19 17:37:56 UTC 2025


> Hello,
> 
> Today, Parallel decides to opt out of using Large pages if the initial heap size does not cover enough Large pages for all spaces. Additionally, if we don't get enough initial 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](https://bugs.openjdk.org/browse/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 setting of the initial heap size.
> 
> For completeness, when user-proided settings for UseNUMA, UseLargePages and InitialHeapSize can't be satisfied at the same time, one must be prioritised over others. Today, we prioritise InitialHeapSize over both UseNUMA and UseLargePages. This change suggest shifting the priority to UseNUMA and UseLargePages, by bumping MinHeapSize to an adequate number. Bumping MinHeapSize directly affects InitialHeapSize, since InitialHeapSize must be equal to or greater than MinHeapSize.
>  
> <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. We bump Min, and in turn also Initial, to accommodate enough Large Pages for all spaces. This is run on a NUMA machine with two NUMA nodes, so we get an extra 2MB when NUMA is enabled for the additi...

Joel Sikström has updated the pull request incrementally with one additional commit since the last revision:

  Albert review feedback

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28394/files
  - new: https://git.openjdk.org/jdk/pull/28394/files/c02e08ad..66928d22

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28394&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28394&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/28394.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28394/head:pull/28394

PR: https://git.openjdk.org/jdk/pull/28394


More information about the hotspot-gc-dev mailing list