bigdata4u / spymemcached

Automatically exported from code.google.com/p/spymemcached
0 stars 0 forks source link

Memory Leak in LinkedBlockingQueue in AsciiMemcachedNodeImpl/TCPMemcachedNodeImpl #305

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Version: spymemcached-2.10.2.jar

We see constant increase in memory with size of LinkedBlockingQueue growing 
beyond 600K.

We also see a lot of CheckedOperationTimeoutException from 
net.spy.memcached.internal.OperationFuture.get(OperationFuture.java:166)

It looks like the operations in the queue are not cleared when the operation 
timesout.

We do this in finally block of MemcachedClient.asyncGet
if (future != null && !future.isDone()) {
    future.cancel(true);
}

does future.cancel(true) interrupt the thread preventing the operation from 
being removed from the queue? Should we use future.cancel(false) instead?  If 
future.cancel(false) is used, can this lead to thread leak if the operation 
didn't complete?

Original issue reported on code.google.com by vinothku...@gmail.com on 4 Jul 2014 at 12:12