JDK-8261894 : Remove support for UseSHM
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: linux
  • Submitted: 2021-02-17
  • Updated: 2024-01-24
  • Resolved: 2023-10-10
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 22
22 b19Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8315498 :  
JDK-8317565 :  
Description
Hotspot currently supports two ways to make use of explicit large pages (huge pages):
- UseHugeTLBFS - explicitly mmap() large pages using MAP_HUGETLB
- UseSHM - create a shared memory segment using shmget() and SHM_HUGETLB

Both these requires that large pages are configured and pre-allocated, the number of currently allocated large pages can be seen with:
> sysctl vm.nr_hugepagessee 

See the kernel documentation for more information:
https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt

The share memory approach also requires the process to be privileged (have the capability to lock memory) and that the system is configured to allow large shared memory segments. To get the current max value:
> sysctl kernel.shmmax

There are very few if any pros with the USeSHM approach and we should investigate if we can remove support for it. 

If we remove UseSHM, we also can remove UseHugeTLBFS, since it is the negation of the other and now implicitly and unconditionally true if we run with static hugepages.


Comments
Changeset: c2abf120 Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2023-10-10 11:10:17 +0000 URL: https://git.openjdk.org/jdk/commit/c2abf120bc231c58de983329cd6c312d18f0e115
10-10-2023

Moving this to the RT subcomponent
07-09-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/14970 Date: 2023-07-21 10:14:14 +0000
01-09-2023