JDK-8248401 : Refactor/unify RMI gc support functionality
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 16
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2020-06-26
  • Updated: 2024-11-20
  • Resolved: 2020-08-07
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 16
16 b11Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description
RMI gc is supported by the CollectedHeap::millis_since_last_gc method. It should return the following:

  // Returns the longest time (in ms) that has elapsed since the last
  // time that any part of the heap was examined by a garbage collection.

which means that the current method name for millis_since_last_gc() is misleading at least for generational collectors as it must not be updated for all "last" gcs, but only for ones matching the description.

Looking at the implementations across collectors, there is also lots of code duplication going on.

In principle it would be sufficient to implement most of it in CollectedHeap: it could keep track of the last time the above condition held true, and the collectors only notify if/when a newer point in time the millis_since_last_gc condition occurs.

Suggested by [~kbarrett] in the review chain leading to  JDK-8248221.
Comments
URL: https://hg.openjdk.java.net/jdk/jdk/rev/f7934f9d4e10 User: tschatzl Date: 2020-08-07 17:24:39 +0000
07-08-2020

Attached a test for the changes which fails for some collectors without this change for several reasons. Not including it in this change because it relies on timing between end of gc and gathering the next RMI time stamp, which due to environment issues could cause false failures. There does not seem to be a way to fix this.
04-08-2020