-
Enhancement
-
Resolution: Fixed
-
P3
-
1.2.0
-
1.1.6
-
sparc
-
solaris_2.5.1
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2016491 | 1.2.0 | Brian Beck | P3 | Resolved | Fixed | 1.2beta3 |
Name: sv38254 Date: 08/12/97
java.lang.Locale.getDefault() is a public static
synchronzied method. This means it is a bottle neck for the
WHOLE VM. This is totally unacceptable for high-end,
high-performance server-side Java processes. This is totally unnecessary...
e.g. the source code is currently
public static synchronized Locale getDefault() {
if (defaultLocale == null) {
String language = System.getProperty("user.language", "EN");
String region = System.getProperty("user.region", "");
defaultLocale = new Locale(language, region);
}
return defaultLocale;
}
You could recode this so the whole method is not synchronized and when you determine that the defaultLocale
is null then peform an internal synchronization
This should make things much better.
You really have to examine all the APIs so they are not
so Applet centric. This sort of coding style is not a problem when you're running a couple of applets - but if
you are running hundreds of simulatenous threads (which we do on the server-side) then this sort of bottleneck is a nightmare.
======================================================================
- backported by
-
JDK-2016491 java.lang.Locale.getDefault() is a public static
-
- Resolved
-
- duplicates
-
JDK-4101184 java.util.Locale.getDefault is synchronized
-
- Closed
-
- relates to
-
JDK-7117936 java.util.Locale getDefault() initialization is broken
-
- Closed
-