[infinispan-dev] Leaking ThreadLocal

Sanne Grinovero sanne at infinispan.org
Wed Jun 11 11:46:56 EDT 2014


On 11 June 2014 11:38, Galder Zamarreño <galder at redhat.com> wrote:
>
> On 10 Jun 2014, at 10:31, Sanne Grinovero <sanne at infinispan.org> wrote:
>
>> Hi all,
>> as spotted by the testsuite - which was rightfully complaining - the
>> CHMv8 which we backported from the JDK has a static ThreadLocal that
>> it uses internally.
>>
>> Our copy is having the same, and so Dan enhanced the "ThreadLocal
>> detection" utility in the testsuite to "allow" specific threadlocal
>> instances; nice as at least infinispan-core now has no more failures.
>>
>> Next the bigger question: this might be ok in the JDK - which
>> obviously doesn't get redeployed - but is it ok in our stuff?
>> I guess the answer is no.. would you all agree that the CHM instances
>> should share an instance whose lifecycle has to be managed by the
>> CacheManager ?
>
> Either that or modify CHMv8 code to use a ConcurrentWeakKeyHashMap<Thread, CounterHashCode> instance variable.

Right, but then we'd need to validate impact on performance, and Weak
References are a nightmare for the JVM to organize.

> We could also email concurrency-interest at cs.oswego.edu to get any other suggestions from Doug et al?

Worst case why not :) But I suspect we can handle this, and they might
not be interested as it's not a bug in the JDK.

Created: https://issues.jboss.org/browse/ISPN-4390

Sanne

>
> Cheers,
>
>>
>> Cheers,
>> Sanne
>> _______________________________________________
>> infinispan-dev mailing list
>> infinispan-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/infinispan-dev
>
>
> --
> Galder Zamarreño
> galder at redhat.com
> twitter.com/galderz
>
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev



More information about the infinispan-dev mailing list