Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Channel sessions not cleaning up (Avoiding Memory Leaks)

$
0
0
Hours of experimentation in attempting to get SshCommand and/or ChannelSessions to properly dispose have led me nowhere. I obviously don't understand the full extent of the SshNet design (How session relates to SshCommand relates to Channel relates to ChannelSession).

At this time, unless there's some movement on suggestions, the only way I've found to actually get the leaks under control is to completely disconnect the SshClient and dispose of it. Then to re-create it and re-connect/authenticate to the server. Given the millions of commands I need to send during my long-term testing, this is not feasible for every command since OpenSsh will think it's a DDoS and throttle. Re-connecting every minute or so (With hundreds of SshCommand.Execute() calls in between) seems to keep the memory leak under some level of control at least. This is not an optimal solution of course, but it works.

Viewing all articles
Browse latest Browse all 1729

Trending Articles