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)

Reply via email to