Open cal2195 opened 8 years ago
After some testing, removing
private void addCloseListener(final ChannelFuture channelFuture) {
channelFuture.channel().closeFuture().addListener(new GenericFutureListener<Future<? super Void>>() {
@Override
public void operationComplete(Future<? super Void> arg0) throws Exception {
LOG.debug("About to close the connection {}, {}.", channelFuture.channel(), initiator ? "initiator" : "from-disptacher");
closeFuture.done();
}
});
}
from PeerConnection.java
seems to have stopped the problem. Is there a good way of preventing this memory leak other than this?
Hello,
I've been working with this library, and I've come across a problem. While using the PeerDHT, after a few hours, my application crashes with OutOfMemory. It appears that the PeerConnections aren't being GC'd, and they build up after a couple of hours!
After inspecting the heap dump, I can see a NioDatagramChannel with 390,509 closeFuture listeners attached, most of which are PeerConnections?
Am I doing something wrong, or is there a reason why tens of thousands of PeerConnections are persisting between 4 peers?
Thanks!