JDK-8318480 : Obsolete UseCounterDecay and remove CounterDecayMinIntervalLength
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 17,21,22
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2023-10-18
  • Updated: 2024-09-17
  • Resolved: 2023-11-21
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 b25Fixed
Related Reports
CSR :  
Relates :  
Relates :  
Description
The UseCounterDecay and CounterDecayMinIntervalLength are not used. 
I can't find them in the code and can compile hotspot without them. 
They are still used in some tests though.

See diff:
15:30@home:~/ws/jdk/open(master)$
~>git diff
diff --git a/src/hotspot/share/runtime/arguments.cpp b/src/hotspot/share/runtime/arguments.cpp
index 1bdd20336ba..4e80a85dc4a 100644
--- a/src/hotspot/share/runtime/arguments.cpp
+++ b/src/hotspot/share/runtime/arguments.cpp
@@ -3892,12 +3892,6 @@ jint Arguments::parse(const JavaVMInitArgs* initial_cmd_args) {
   if (TraceBytecodesAt != 0) {
     TraceBytecodes = true;
   }
-  if (CountCompiledCalls) {
-    if (UseCounterDecay) {
-      warning("UseCounterDecay disabled because CountCalls is set");
-      UseCounterDecay = false;
-    }
-  }
 #endif // PRODUCT
 
   if (ScavengeRootsInCode == 0) {
diff --git a/src/hotspot/share/runtime/globals.hpp b/src/hotspot/share/runtime/globals.hpp
index 4ae156a773e..edf8e428055 100644
--- a/src/hotspot/share/runtime/globals.hpp
+++ b/src/hotspot/share/runtime/globals.hpp
@@ -1220,15 +1220,10 @@ const int ObjectAlignmentInBytes = 8;
   product(bool, UseCompiler, true,                                          \
           "Use Just-In-Time compilation")                                   \
                                                                             \
-  product(bool, UseCounterDecay, true,                                      \
-          "Adjust recompilation counters")                                  \
                                                                             \
   develop(intx, CounterHalfLifeTime,    30,                                 \
           "Half-life time of invocation counters (in seconds)")             \
                                                                             \
-  develop(intx, CounterDecayMinIntervalLength,   500,                       \
-          "The minimum interval (in milliseconds) between invocation of "   \
-          "CounterDecay")                                                   \
                                                                             \
   product(bool, AlwaysCompileLoopMethods, false,                            \
           "When using recompilation, never interpret methods "              \

Comments
Thanks [~ysr]. Indeed, CounterHalfLifeTime has no uses and should also be removed. I'll make a new issue.
17-09-2024

A pull request was submitted for review. Branch: master URL: https://git.openjdk.org/jdk/pull/16673 Date: 2023-11-15 09:40:46 +0000
16-09-2024

https://github.com/openjdk/jdk/pull/16673/files#r1762090336 Although mentioned above in the Description, it seems like `CounterHalfLifeTime` may have been missed in this cleanup.
16-09-2024

Changeset: 92320707 Author: Daniel Lundén <daniel.lunden@oracle.com> Committer: David Holmes <dholmes@openjdk.org> Date: 2023-11-21 10:58:09 +0000 URL: https://git.openjdk.org/jdk/commit/923207073af985a1b72de3c777d55b0c2d392b25
21-11-2023

These are leftovers from JDK-8251462 and should be removed. Since UseCounterDecay is a product flag, a CSR is required.
19-10-2023