JDK-8277241 : java -Xshare:on document needs to be updated
  • Type: Bug
  • Component: docs
  • Sub-Component: hotspot
  • Affected Version: 17
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-11-16
  • Updated: 2022-01-25
  • Resolved: 2022-01-11
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 17
17.0.3-oracleFixed
Related Reports
Relates :  
Relates :  
Description
https://docs.oracle.com/en/java/javase/17/vm/class-data-sharing.html#GUID-0260F857-A70E-4399-A1DF-A5766BE33285

The existing text:

Note:The -Xshare:on is for testing purposes only and may cause intermittent failures due to the use of address space layout randomization by the operating system. This option should not be used in production environments.

should be replaced with

Note:The -Xshare:on option is for testing purposes only. It may cause the VM to unexpectedly exit during start-up when the CDS archive cannot be used (for example, when certain VM parameters are changed, or when a different JDK is used). This option should not be used in production environments.
Comments
[~ssatish] the above changes for JDK-8277241 looks OK to me.
11-01-2022

The "intermittent failures due to the use of address space layout randomization by the operating system" mentioned in the original text has been fixed in JDK-8231610. However, since -Xshare:on still have other failure modes, it should not be used in production.
16-11-2021