JDK-7162007 : Clean up i18n related caches
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 8
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2012-04-17
  • Updated: 2015-03-31
  • Resolved: 2013-01-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b75Fixed
Related Reports
Relates :  
Description
The i18n classes in java.util and java.text have caches to keep locale-dependent data. But these caches are rather ad hoc. They need some review and clean up based on their efficiencies.

Comments
Existing Caches (locale data related). - java.text.BreakIterator: "private static final SoftReference<BreakIteratorCache>[] iterCache" (Locale -> BI instance (per type)) - java.text.Collator: "private static final ConcurrentMap<Locale, SoftReference<Collator>> cache" - java.text.DateFormatSymbols: "private static final ConcurrentMap<Locale, SoftReference<DateFormatSymbols>> cachedInstances" - java.text.DecimalFormatSymbols: "private static final ConcurrentMap<Locale, Object[]> cachedLocaleData" (Locale -> NumberElements/Currency) - java.text.DecimalFormat: "private static final ConcurrentMap<Locale, String> cachedLocaleData" (Locale -> NumberPattern) - java.text.SimpleDateFormat: "private static final ConcurrentMap<Locale, NumberFormat> cachedNumberFormatData" - java.util.Calendar: "private static final ConcurrentMap<Locale, int[]> cachedLocaleData" (Locale -> firstDayOfWeek/minimalDaysInFirstWeek) - java.util.TimeZone: "private static final Map<String, SoftReference<Map<Locale, String[]>>> CACHE" (id -> (Locale -> names)) - sun.util.locale.provider.LocaleResources: "private ConcurrentMap<String, Object> cache" (name -> OpenListResourceBundle) - sun.util.locale.provider.TimeZoneNameUtility: "private static ConcurrentHashMap<Locale, SoftReference<OpenListResourceBundle>> cachedBundles" (Locale -> TimeZoneNames bundle) "private static ConcurrentHashMap<Locale, SoftReference<String[][]>> cachedZoneData" (Locale -> ZoneData(id->names[])) - sun.util.locale.provider.LocaleServiceProviderPool: "private static ConcurrentMap<Class<? extends LocaleServiceProvider>, LocaleServiceProviderPool> poolOfPools" (class -> pool) "private ConcurrentMap<LocaleProviderAdapter.Type, LocaleServiceProvider> providers" (type -> provider impl) "private ConcurrentMap<Locale, List<LocaleProviderAdapter.Type>> providersCache" (Locale -> list of available adapters) - sun.util.locale.provider.JRELocaleProviderAdapter: "private final ConcurrentMap<Locale, LocaleResources> localeResourcesMap" (Locale -> LocaleResources) - sun.util.locale.provider.HostLocaleProviderAdapterImpl: (Windows) private static ConcurrentMap<Locale, SoftReference<AtomicReferenceArray<String>>> dateFormatCache private static ConcurrentMap<Locale, SoftReference<DateFormatSymbols>> dateFormatSymbolsCache private static ConcurrentMap<Locale, SoftReference<AtomicReferenceArray<String>>> numberFormatCache private static ConcurrentMap<Locale, SoftReference<DecimalFormatSymbols>> decimalFormatSymbolsCache (MacOSX) private static ConcurrentMap<Locale, SoftReference<AtomicReferenceArray<String>>> dateFormatPatternsMap private static ConcurrentMap<Locale, SoftReference<AtomicReferenceArray<String>>> numberFormatPatternsMap private static ConcurrentMap<Locale, SoftReference<DateFormatSymbols>> dateFormatSymbolsMap private static ConcurrentMap<Locale, SoftReference<DecimalFormatSymbols>> decimalFormatSymbolsMap
09-11-2012