Integrated: 8257901: ZGC: Take virtual memory usage into account when sizing heap
Per Liden
pliden at openjdk.java.net
Thu Dec 10 11:13:35 UTC 2020
On Tue, 8 Dec 2020 13:41:56 GMT, Per Liden <pliden at openjdk.org> wrote:
> 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.
This pull request has now been integrated.
Changeset: 0a0691eb
Author: Per Liden <pliden at openjdk.org>
URL: https://git.openjdk.java.net/jdk/commit/0a0691eb
Stats: 38 lines in 7 files changed: 24 ins; 0 del; 14 mod
8257901: ZGC: Take virtual memory usage into account when sizing heap
Reviewed-by: stefank, eosterlund, ayang, tschatzl
-------------
PR: https://git.openjdk.java.net/jdk/pull/1696
More information about the hotspot-dev
mailing list