JDK-8209162 : Page size selection does not always select optimal page size
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-08-08
  • Updated: 2020-04-27
  • Resolved: 2020-04-22
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 15
15 b20Fixed
Related Reports
Relates :  
Description
Garbage collectors determine effective page size for a given Java heap (and other data structures) by calling os::page_size_for_region_aligned() with a min_page argument of 8 which is fixed.

In some cases this may cause the algorithm to use a suboptimal page size, in particular if the page size is very large compared to the reserved space size.

The intent of this divisor is to guarantee a small amount of flexibility in committing only parts of the heap if desired (e.g. -Xms != -Xmx).

E.g. when using 1GB large pages, the forced divisor of 8 will cause GC to use small pages if e.g. heap size min and max has been set to 4GB (no on-demand heap commit requested).

In that example 4GB divides to 512M, and the algorithm selects the next smaller page size which is 4k on x86, which may be somewhat detrimental to performance.

At least the generational collectors (serial, cms, parallel) have that issue, but also check others.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/eee3372536ce User: sjohanss Date: 2020-04-22 09:00:13 +0000
22-04-2020

To find the places in the code search for uses of os::page_size_for_region_aligned().
08-08-2018