--- old/src/share/vm/memory/referenceProcessor.cpp 2011-12-09 11:25:20.596200349 -0800 +++ new/src/share/vm/memory/referenceProcessor.cpp 2011-12-09 11:25:20.366738000 -0800 @@ -43,7 +43,9 @@ } void ReferenceProcessor::init_statics() { - jlong now = os::javaTimeMillis(); + // We need a montonically increasing time in ms but os::javaTimeMillis() + // does not guarantee montonicity. + jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; // Initialize the soft ref timestamp clock. _soft_ref_timestamp_clock = now; @@ -151,7 +153,10 @@ void ReferenceProcessor::update_soft_ref_master_clock() { // Update (advance) the soft ref master clock field. This must be done // after processing the soft ref list. - jlong now = os::javaTimeMillis(); + + // We need a montonically increasing time in ms but os::javaTimeMillis() + // does not guarantee montonicity. + jlong now = os::javaTimeNanos() / NANOSECS_PER_MILLISEC; jlong soft_ref_clock = java_lang_ref_SoftReference::clock(); assert(soft_ref_clock == _soft_ref_timestamp_clock, "soft ref clocks out of sync");