changeset 12026:ab2b45b79d71

Find changesets by keywords (author, files, the commit message), revision
number or hash, or revset expression.

8164482: [REDO] G1 does not implement millis_since_last_gc which is needed by RMI GC
Summary: G1 does not return a correct value for the CollectedHeap::millis_since_last_gc()
Reviewed-by: tschatzl, kbarrett

--- a/src/share/vm/gc/shared/genCollectedHeap.cpp Sun Sep 18 21:10:48 2016 -0400+++ b/src/share/vm/gc/shared/genCollectedHeap.cpp Tue Sep 20 10:27:51 2016 -0400@@ -1256,21 +1256,20 @@ }; jlong GenCollectedHeap::millis_since_last_gc() {- // We need a monotonically non-decreasing time in ms but- // os::javaTimeMillis() does not guarantee monotonicity.+ // javaTimeNanos() is guaranteed to be monotonically non-decreasing+ // provided the underlying platform provides such a time source+ // (and it is bug free). So we still have to guard against getting+ // back a time later than 'now'. jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; GenTimeOfLastGCClosure tolgc_cl(now); // iterate over generations getting the oldest // time that a generation was collected generation_iterate(&tolgc_cl, false);- // javaTimeNanos() is guaranteed to be monotonically non-decreasing- // provided the underlying platform provides such a time source- // (and it is bug free). So we still have to guard against getting- // back a time later than 'now'. jlong retVal = now - tolgc_cl.time(); if (retVal < 0) {- NOT_PRODUCT(log_warning(gc)("time warp: " JLONG_FORMAT, retVal);)+ log_warning(gc)("millis_since_last_gc() would return : " JLONG_FORMAT+ ". returning zero instead.", retVal); return 0; } return retVal;