RFR: 8257901: ZGC: Take virtual memory usage into account when sizing heap [v4]

Per Liden pliden at openjdk.java.net
Thu Dec 10 09:41:49 UTC 2020


> MaxVirtMemFraction limits the amount of address space the GC should use for the heap. This is used by the heuristics in Arguments::set_heap_size() to select an appropriate default max heap size. However, that heuristic can select a max heap size that will not fit with ZGC, since ZGC uses additional address space (for multi-mapping and the virtual-to-physical ratio). As a result, if the address space is limited, and -Xmx is not specified, then ZGC might refuse to start with the error:
> 
> "Failed to reserve enough address space for Java heap"
> 
> I propose we abstract MaxVirtMemFraction to make it configurable for each GC, so that the heuristics in Arguments::set_heap_size() will pick a default max heap size that also works for ZGC.
> 
> Testing: Manual testing using different ulimit -v sizes.

Per Liden has updated the pull request incrementally with one additional commit since the last revision:

  Add workaround for AggressiveHeap

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1696/files
  - new: https://git.openjdk.java.net/jdk/pull/1696/files/eaaf4f97..36a099c8

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1696&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1696&range=02-03

  Stats: 7 lines in 1 file changed: 6 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1696.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1696/head:pull/1696

PR: https://git.openjdk.java.net/jdk/pull/1696


More information about the hotspot-dev mailing list