hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiroshi Ikeda (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HADOOP-10306) Unnecessary weak reference map to cache classes in Configuration
Date Wed, 29 Jan 2014 06:24:08 GMT
Hiroshi Ikeda created HADOOP-10306:
--------------------------------------

             Summary: 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.1.5#6160)

Mime
View raw message