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

Mike Drob commented on SOLR-14576:
----------------------------------

I'm worried about two things here -

1) Using String as a key in an Identity HashMap seems dubious, but probably not 
any more dubious than the SolrCore itself.
2) Would the liveness of the the String be different than the liveness of the 
SolrCore? i.e. would it be possible that the SolrCore is GC'd but that the 
String is still around because there are other references to it? I think this 
is fairly likely actually, but I don't have any analysis to prove it.

I'm -1 on this change as is. Would like to see some tests around it, or some 
profiler analysis that shows we should be worried about things here before we 
start making changes.

> HttpCacheHeaderUti.etagCoreCache should not use a SolrCore as key
> -----------------------------------------------------------------
>
>                 Key: SOLR-14576
>                 URL: https://issues.apache.org/jira/browse/SOLR-14576
>             Project: Solr
>          Issue Type: Bug
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Noble Paul
>            Priority: Minor
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> GC performance is affected when the key is a complex data structure. We can 
> make it
> {code}
> private static WeakIdentityMap<String, EtagCacheVal> etagCoreCache = 
> WeakIdentityMap.newConcurrentHashMap();
> {code}
> instead of
>  {code}
> private static WeakIdentityMap<SolrCore, EtagCacheVal> etagCoreCache = 
> WeakIdentityMap.newConcurrentHashMap();
> {code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to