JDK-8233597 : Clean up code in G1Analytics::compute_pause_time_ratio
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 14
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-11-05
  • Updated: 2019-12-03
  • Resolved: 2019-11-22
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 14
14 b25Fixed
Related Reports
Blocks :  
Relates :  
Description
In G1Analytics::compute_pause_time_ratio() there is this code:

  if (_recent_avg_pause_time_ratio < 0.0 ||
      (_recent_avg_pause_time_ratio - 1.0 > 0.0)) {
    // Clip ratio between 0.0 and 1.0, and continue. This will be fixed in
    // CR 6902692 by redoing the manner in which the ratio is incrementally computed.
    if (_recent_avg_pause_time_ratio < 0.0) {
      _recent_avg_pause_time_ratio = 0.0;
    } else {
      assert(_recent_avg_pause_time_ratio - 1.0 > 0.0, "Ctl-point invariant");
      _recent_avg_pause_time_ratio = 1.0;
    }
  }

that could be simplified using MIN/MAX methods or the clamp() method introduced by JDK-8233702


Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/f4f60bb75ee4 User: tschatzl Date: 2019-11-22 09:04:11 +0000
22-11-2019