You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "Lluis Martinez (JIRA)" <ji...@apache.org> on 2015/12/03 23:21:11 UTC
[jira] [Updated] (HADOOP-10306) Unnecessary weak reference map to
cache classes in Configuration
[ https://issues.apache.org/jira/browse/HADOOP-10306?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Lluis Martinez updated HADOOP-10306:
------------------------------------
Assignee: (was: Lluis Martinez)
> Unnecessary weak reference map to cache classes in Configuration
> ----------------------------------------------------------------
>
> Key: HADOOP-10306
> URL: https://issues.apache.org/jira/browse/HADOOP-10306
> Project: Hadoop Common
> Issue Type: Bug
> Reporter: Hiroshi Ikeda
> Priority: Trivial
>
> In Configuration.getClassByNameOrNull():
> {code}
> synchronized (CACHE_CLASSES) {
> map = CACHE_CLASSES.get(classLoader);
> if (map == null) {
> map = Collections.synchronizedMap(
> new WeakHashMap<String, WeakReference<Class<?>>>());
> CACHE_CLASSES.put(classLoader, map);
> }
> }
> {code}
> Change "new WeaHashMap<String, ...>()" to "new HashMap<String, ...>" or something. Otherwise, even while the class is actively used, this may drop its class cache.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)