--- old/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2020-08-07 13:15:59.762046247 +0200 +++ new/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2020-08-07 13:15:59.638044277 +0200 @@ -843,7 +843,6 @@ elapsedTimer PSParallelCompact::_accumulated_time; unsigned int PSParallelCompact::_total_invocations = 0; unsigned int PSParallelCompact::_maximum_compaction_gc_num = 0; -jlong PSParallelCompact::_time_of_last_gc = 0; CollectorCounters* PSParallelCompact::_counters = NULL; ParMarkBitMap PSParallelCompact::_mark_bitmap; ParallelCompactData PSParallelCompact::_summary_data; @@ -1070,8 +1069,8 @@ heap->gen_mangle_unused_area(); } - // Update time of last GC - reset_millis_since_last_gc(); + // Signal that we have completed a visit to all live objects. + Universe::heap()->record_whole_heap_examined_timestamp(); } HeapWord* @@ -3197,25 +3196,6 @@ } } -jlong PSParallelCompact::millis_since_last_gc() { - // We need a monotonically non-decreasing time in ms but - // os::javaTimeMillis() does not guarantee monotonicity. - jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; - jlong ret_val = now - _time_of_last_gc; - // XXX See note in genCollectedHeap::millis_since_last_gc(). - if (ret_val < 0) { - NOT_PRODUCT(log_warning(gc)("time warp: " JLONG_FORMAT, ret_val);) - return 0; - } - return ret_val; -} - -void PSParallelCompact::reset_millis_since_last_gc() { - // We need a monotonically non-decreasing time in ms but - // os::javaTimeMillis() does not guarantee monotonicity. - _time_of_last_gc = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; -} - ParMarkBitMap::IterationStatus MoveAndUpdateClosure::copy_until_full() { if (source() != copy_destination()) {