JDK-8325498 : Make TrimNativeHeapInterval a product switch
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 17-pool,21-pool,22-pool,23
  • Submitted: 2024-02-08
  • Updated: 2024-02-29
  • Resolved: 2024-02-20
Related Reports
CSR :  
CSR :  
CSR :  
Description
Summary
-------

Make `TrimNativeHeapInterval` a product switch

Problem
-------

JDK-8293114 introduced automatic C-heap trimming, for now supported only by the glibc. It is controlled by the command line switch `TrimNativeHeapInterval`. 
The feature has proven to be very valuable to customers, and all issues have been ironed out. Therefore, I propose to make this switch a non-experimental
product switch.

Solution
--------

The solution is to remove the EXPERIMENTAL moniker from this switch.

In addition to that, the `java` man page will be changed to mention this option as well as its limitation to Linux glibc-based systems.

In addition to that, a release note will be written.

Specification
-------------

```
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -1996,7 +1996,7 @@ const int ObjectAlignmentInBytes = 8;
           "2: monitors & new lightweight locking (LM_LIGHTWEIGHT)")         \
           range(0, 2)                                                       \
                                                                             \
-  product(uint, TrimNativeHeapInterval, 0, EXPERIMENTAL,                    \
+  product(uint, TrimNativeHeapInterval, 0,                                  \
           "Interval, in ms, at which the JVM will trim the native heap if " \
           "the platform supports that. Lower values will reclaim memory "   \
           "more eagerly at the cost of higher overhead. A value of 0 "      \
```

Comments
Moving to Approved.
20-02-2024

Joe, can this be approved? Thank you!
20-02-2024

[~stuefe] you need to mark this as Finalized.
20-02-2024

Reviewed - thanks.
18-02-2024

I think the fact this only actually works on Linux with glibc needs to be advertised more prominently if this becomes a product flag. I suggest a Release Note, plus an entry in the java manpage as part of this PR. Thanks.
12-02-2024

Moving to Provisional, not Approved. [~dholmes], please review this request.
10-02-2024

This seems to be a good thing. Maybe this should also be backported to JDK 21 and 17 then, since the feature itself was brought there as well? Then these releases should be covered in this CSR. I'm adding them.
09-02-2024