JDK-8213927 : G1 ignores AlwaysPreTouch when UseTransparentHugePages is enabled
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9,10,11.0.1
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • CPU: x86
  • Submitted: 2018-11-13
  • Updated: 2023-12-15
  • Resolved: 2018-11-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 11 JDK 12
11.0.23-oracleFixed 12 b22Fixed
Related Reports
Relates :  
Relates :  
Description
 A DESCRIPTION OF THE PROBLEM :
G1 ignores AlwaysPreTouch when UseTransparentHugePages is enabled

REGRESSION : Last worked in version 8u181

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
time java -XX:+UseG1GC -Xmx10g -Xms10g -XX:+AlwaysPreTouch -XX:+UseTransparentHugePages HelloWorld

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Hello, World

real    0m4.737s
user    0m0.417s
sys     0m4.349s
ACTUAL -
Hello, World

real    0m0.418s
user    0m0.168s
sys     0m0.314s

---------- BEGIN SOURCE ----------
public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World");
    }
}
---------- END SOURCE ----------

FREQUENCY : always



Comments
[jdk11u-fix-request] Approval Request from Amos “Backporting for parity with jdk 11.0.23-oracle. Clean backort. SAP nightlies passed on 2023-12-14”
14-12-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk11u-dev/pull/2355 Date: 2023-12-12 09:13:29 +0000
12-12-2023

Commit: https://github.com/openjdk/jdk/commit/fc8795984a9dfb9054663cef78848135f05ba011 Author: Thomas Schatzl <tschatzl@openjdk.org> Date: Thu Nov 22 09:26:51 2018 +0100
05-12-2023

URL: http://hg.openjdk.java.net/jdk/jdk/rev/533b02f7842c User: tschatzl Date: 2018-11-22 08:27:43 +0000
22-11-2018

noreg-hard justification: The test would need to do OS specific checking of RSS sizes, making it rather complicated.
15-11-2018

I think the simplest fix is to just change the pretouch code to override the page size with small page page size when -XX:+UseTransparentHugePages is set.
15-11-2018

Only G1 affected - in all other cases pretouch always touchs on small page size basis.
15-11-2018

The pretouch code new to JDK9 (JDK-8157952) wronlgy assumes that large pages should be used for pretouching in this case.
15-11-2018

I am unable to reproduce this issue, as the linux machine which i am using doesn't support usage of Transparent Huge Pages Facing below issue == -sh-4.2$ time /scratch/fairoz/JAVA/jdk12/jdk-12-ea+15/bin/java -XX:+UseG1GC -Xmx10g -Xms10g -XX:+AlwaysPreTouch -XX:+UseTransparentHugePages HelloWorld Java HotSpot(TM) 64-Bit Server VM warning: TransparentHugePages is not supported by the operating system. ==
15-11-2018