7129514: time warp warnings after 7117303

Replace calls to os::javaTimeMillis() that are used to update the milliseconds since the last GC to an equivalent that uses a monotonically non-decreasing time source.

Reviewed-by: ysr, jmasa
This commit is contained in:
John Cuthbertson 2012-01-18 09:50:16 -08:00
parent 6a31970946
commit fa9d6d7682
4 changed files with 23 additions and 6 deletions

View file

@ -176,7 +176,11 @@ void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
// Update time of last gc for all generations we collected
// (which curently is all the generations in the heap).
gch->update_time_of_last_gc(os::javaTimeMillis());
// We need to use a monotonically non-deccreasing time in ms
// or we will see time-warp warnings and os::javaTimeMillis()
// does not guarantee monotonicity.
jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC;
gch->update_time_of_last_gc(now);
}
void GenMarkSweep::allocate_stacks() {