[
https://issues.apache.org/jira/browse/SSHD-793?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16322273#comment-16322273
]
Goldstein Lyor commented on SSHD-793:
-------------------------------------
P.S. what about this code:
{code:java|title=Nio2Connector}
protected Nio2CompletionHandler<Void, Object> createConnectionCompletionHandler(
IoConnectFuture future, AsynchronousSocketChannel socket,
FactoryManager manager, IoHandler handler) {
return new Nio2CompletionHandler<Void, Object>() {
@Override
@SuppressWarnings("synthetic-access")
protected void onCompleted(Void result, Object attachment) {
try {
Nio2Session session = createSession(manager, handler,
socket);
handler.sessionCreated(session);
long sessionId = session.getId();
sessions.put(sessionId, session);
future.setSession(session);
session.startReading();
{code}
Shouldn't we do the same ?
> Continuously connecting to sshd server lead to memory leaks
> -----------------------------------------------------------
>
> Key: SSHD-793
> URL: https://issues.apache.org/jira/browse/SSHD-793
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 1.7.0
> Environment: Linux
> Reporter: Li Fangning
> Attachments: SshClientTest.java, SshdServerTest.java, changes.png
>
>
> Run the attachments [^SshdServerTest.java] and [^SshClientTest.java],
> [^SshdServerTest.java]'s memory will continue to rise and lead to
> {{OutOfMemory}} error.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)