Open GoogleCodeExporter opened 9 years ago
Original comment by ingen...@gmail.com
on 4 Mar 2013 at 8:43
Memory leak cause is unbounded operation queues.
Just do:
ConnectionFactoryBuilder builder = new ConnectionFactoryBuilder()
.setOpQueueFactory(new ConfigurableOperationQueueFactory(MAX_QUEUE_SIZE)
.setReadOpQueueFactory(new ConfigurableOperationQueueFactory(...)
.setWriteOpQueueFactory(new ConfigurableOperationQueueFactory(...)
public class ConfigurableOperationQueueFactory implements OperationQueueFactory
{
private int capacity;
public ConfigurableOperationQueueFactory(int cap) {
this.capacity = cap;
}
@Override
public BlockingQueue<Operation> create() {
if (capacity > 0) {
return new ArrayBlockingQueue<>(capacity);
} else {
return new LinkedBlockingQueue<>();
}
}
}
Original comment by Panov.A...@gmail.com
on 28 May 2015 at 9:50
Original issue reported on code.google.com by
sergej.w...@gmail.com
on 29 Jan 2013 at 3:13