RFR: 8289220: Locale.forLanguageTag throws NPE due to soft ref used in locale cache being cleared [v6]

Alan Bateman alanb at openjdk.org
Wed Jun 7 12:51:01 UTC 2023


On Wed, 7 Jun 2023 11:55:57 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

> That being said, the number of long-lived `BaseLocale` objects is very limited; we only keep them in Locale, LocaleKey, and Locale.CONSTANT_LOCALES. Unless I'm missing something, we could solve this problem by removing `BaseLocale` caching, and improve performance at the same time.

The motivation seems to be startup ([JDK-8196869](https://bugs.openjdk.org/browse/JDK-8196869)). It looks like it needs to be re-evaluated and if we continue with caching in this area then I think we'll need some stress tests to go with it.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/14211#issuecomment-1580746429


More information about the core-libs-dev mailing list