Submitted On 10-OCT-2001
I am experiencing this behavior not only when using sleep
with small arguments, but rather big ones too, like 40000
ms for example. The same behavior appears even when the
thread is blocked by invoking wait() on it and is doing
nothing. The system clock gains about 10 sec every minute,
no matter whether the thread is waking up every minute and
going back to sleep for another minute, or it is
permanently blocked and waiting for another process to wake
it up. This behavior does definitely not appear in Linux or
Windows NT and does definitely appear in Windows 2000.
Submitted On 14-MAR-2002
This isn't specific to sleeps of under 10ms. A sleep that isn't an exact multiple of 10ms will have the same
effect. From the 1.3 SCSL code for hotspot, the constructor/destructor of class HighResolutionInterval
calculate <sleep duration>%10 and call timeBeginPeriod/timeEndPeriod if the mod isn't zero. We had exactly
this problem with an app that did a lot of Thread.sleep(15). Changing it to Thread.sleep(20) fixed it.
Submitted On 27-SEP-2002
I agree with manu4ever. I have also experienced similar
behaviour, the system clock runs faster when a Thread.sleep
(with a time duration of non-multiple of 10)is used in between
two System.currentTimeMills() call.
One workaround is to use Object.wait() inplaceof Thread.sleep
(). Wait doesn't have any effect of time shift.
Submitted On 25-NOV-2002
Some computer can reproduce this problem with 1.3.1_04 or
Are you sure you fixed this?
Submitted On 06-DEC-2002
It seems that the fix for this breaks sleeps with even 10 ms
multiples on a dual cpu machine. A sleep(10) on JDK
1.2.2_011 on W2K is OK (7% error in time). On 1.3 (and on)
it gives 56% error. The fix does not take into account that
the timer resolution on a 2 CPU machine is 15625000 ns.
Submitted On 04-MAR-2003
The bug is NOTclosed in my opinion,
the flag -XX:+ForceTimeHighResolution (see related bug
4814012 for details) is only a workaround and must be more
documented here !!!
With jdk/jre 1.4.1 the bug is confirmed on Windows 2000 SP3
(and NOT before) and Windows XP SP1 (not checked without
Submitted On 15-APR-2004
Many Pentium4 computers reproduce this problem
with JDK1.3.1_10 and JDK1.4.2.
Pentium2/3 computers arenot reproduce.
Is this problem depends hardware?
Submitted On 21-APR-2004
A Java program which calls in a loop first sleep with
9ms and then with 10ms causes the system clock to
run on our computer at double speed.
The problem only occures if the HAL 'halaacpi'
or 'halmacpi' is used.
Depending on the hardware, the clock runs too fast
with the following factors : 2 1.6 1.04
For further information on the behaviour see also the
following Microsoft page:
Submitted On 04-AUG-2004
Bug stil exists in 1.4.2_00
Where is cure?
Submitted On 22-FEB-2006
The bug does still exist in JRE5.0.
Submitted On 02-MAY-2006
Please re-open this bug, this is still occurring on certain windows hardware such as hp-compaq D530 SFF pentium 4. Reproduced using JRE 1.4.2_06 and _08.
Submitted On 28-AUG-2006
See also 6435126 (the see also list above has been truncated)
Please add all further comments to either 6435126 or 5005837.
PLEASE NOTE: JDK6 is formerly known as Project Mustang