JDK-8302385 : Remove MetaspaceReclaimPolicy=none
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 21
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-02-14
  • Updated: 2023-07-13
  • Resolved: 2023-02-16
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 21
21 b11Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8302708 :  
Description
Metaspace, since JEP-387, reclaims memory after purging and returns it to the Operating System. We added a MetaspaceReclaimPolicy switch to control this behavior. Among other things, we allow reclamation to be completely disabled (MetaspaceReclaimPolicy=none). This was a fallback mechanism in case the JEP-387 metaspace turned out buggy. 

But post-JEP-387 metaspace is pretty stable, and has been in the OpenJDK since Java 16, so this reclaim mode is not needed (see also CSR JDK-8302130).

This mode makes backend coding and test coding more complex, since arguing about how much memory we expect metaspace to have committed is difficult if we don't reclaim. Removing this mode would remove some of that complexity.
Comments
[~stuefe] was this option ever documented? If not then its removal does not need a release note. EDIT: I see now the RN does not really pertain to this issue.
13-07-2023

Changeset: 519229db Author: Thomas Stuefe <stuefe@openjdk.org> Date: 2023-02-16 07:01:10 +0000 URL: https://git.openjdk.org/jdk/commit/519229db3c75e56b4f6e05d918300f1cead1c3b1
16-02-2023

A pull request was submitted for review. URL: https://git.openjdk.org/jdk/pull/12554 Date: 2023-02-14 10:26:02 +0000
15-02-2023