--- a/hotspot/src/share/vm/memory/defNewGeneration.cpp Tue Feb 14 08:21:08 2012 -0500
+++ b/hotspot/src/share/vm/memory/defNewGeneration.cpp Wed Jan 18 09:50:16 2012 -0800
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2012, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -655,7 +655,12 @@
from()->set_concurrent_iteration_safe_limit(from()->top());
to()->set_concurrent_iteration_safe_limit(to()->top());
SpecializationStats::print();
- 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;
+ update_time_of_last_gc(now);
}
class RemoveForwardPointerClosure: public ObjectClosure {