[ 
https://issues.apache.org/jira/browse/HADOOP-10306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13890490#comment-13890490
 ] 

Hiroshi Ikeda commented on HADOOP-10306:
----------------------------------------

Sorry, I mistook about Records.newRecords(), which also uses own cache.

> 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