Bug 2232072

Summary: THPs cause huge RSS due to thread start timing issue
Product: Red Hat Enterprise Linux 8 Reporter: kazuhiro kawana <kkawana>
Component: java-11-openjdkAssignee: Thomas Stuefe <tstuefe>
Status: NEW --- QA Contact: OpenJDK QA <java-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 8.2CC: myoshida, tstuefe
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description kazuhiro kawana 2023-08-15 07:25:26 UTC
### Description of problem:
If THP (Transparent Huge Pages) are enabled unconditionally on the system, java applications that use many threads may see a huge Resident Set Size. That footprint is caused by thread stacks being mostly paged in. 

The issue was reported in JDK bug database and already fixed:

THPs cause huge RSS due to thread start timing issue
https://bugs.openjdk.org/browse/JDK-8312182

We checked source code in src rpm, it looks OpenJDK 11(latest)  and OpenJDK 17 does not contain the above fix. 
Please a backport the fix.

### Version-Release number of selected component (if applicable):

java-11-openjdk-11.0.20.0.8-3.el8
java-17-openjdk-17.0.8.0.7-2.el8


### How reproducible:

Anytime

### Steps to Reproduce:

N/A

### Actual results:

N/A

### Expected results:
If enabling them "always", it can not lead to huge memory footprint and bad startup performance