-
Enhancement
-
Resolution: Fixed
-
P4
-
16
-
b11
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 toJDK-8248221.
// 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
- duplicates
-
JDK-8248221 G1: millis_since_last_gc updated at wrong time
-
- Closed
-
-
JDK-8250955 ZGC: Wrong second to millisecond conversion in ZCollectedHeap::millis_since_last_gc()
-
- Closed
-
-
JDK-8165501 Serial, Parallel and G1 should track the time since last gc for millis_since_last_gc() with full precision
-
- Closed
-
-
JDK-8243974 Move G1CollectedHeap::millis_since_last_gc support from G1Policy
-
- Closed
-