Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2155454 | 1.4.2_18 | Sean Coffey | P3 | Resolved | Fixed | b05 |
Name: nt126004 Date: 05/28/2002
FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_03-b03)
Java HotSpot(TM) Client VM (build 1.3.1_03-b03, mixed mode)
FULL OPERATING SYSTEM VERSION :
Microsoft Windows 2000 [Version 5.00.2195]
A DESCRIPTION OF THE PROBLEM :
TimeZone.getDefault() is a static synchronzied method. In
it the code checks to see if the default time zone has been
initialized and if not initializes it. Once an initialized
default is available it is cloned and returned to the
caller. However the call to clone() need not be
synchronized and causes uneeded contention.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Write a multithreaded application which uses
TimeZone.getDefault() (which many Date operations use).
Get a profiler which can show you how much time you spend
blocked trying to get the lock on TimeZone.class.
2.
3.
This bug can be reproduced always.
CUSTOMER WORKAROUND :
Cache TimeZone.getDefault yourself in user code.
Unfortunately this isn't always possible because in some
cases the caller is also JDK or third party code.
(Review ID: 146743)
======================================================================
- backported by
-
JDK-2155454 TimeZone.getDefault() has too much synchronization
- Resolved
- duplicates
-
JDK-4845983 TimeZone.getDefault() is too slow, hurt overall performance, especially on SMP
- Closed
- relates to
-
JDK-5079972 (tz) Eliminate synchronization from TimeZone.getDefault
- Closed
-
JDK-4936432 GregorianCalendar should support shared TimeZone
- Closed
-
JDK-5073554 java.util.Date is a performance bottleneck
- Closed