SSHClient: ForwardedPortLocal: memory issue
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- csharp
- 領域
- networking
調査の方向性
ConnectSSH エントリポイントと、レポートに示されている ForwardedPortLocal の繰り返し作成から始めます。一晩中実行するシナリオまたは繰り返し呼び出すシナリオを再現し、その後、ポートフォワーディングのライフサイクルと破棄の動作を追跡します。繰り返し接続してもメモリ使用量が継続的に増加しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Hello,
I am using the following code below. I call this ConnectSSH() every 5 seconds (as a test to see how it performs)
After I let this run a night, i see that the used memory increased significantly, and it keeps rising.
After some investigation on my own, i notice that when I remove the "forwardedportlocal" object, (so I don't make such an object, and I obviously don't start it) Then there is no memory issue. The client is created, and then disposed cleanly.
I can see this happening the diagnostic tool of visual studio.
I already added portfwld.stop() and portfwld.dispose() together with of course SshClient.disconnect() and SshClient.dispose()
but that did not help.
I made a version in vb.net and also one in c#, but the results are the same.
I also Commented the connection to the database to show that this is not the issue.
I hope someone can give me some insight of what is happening, or perhaps what I am doing wrong?
class mySQLviaSHH
{
public void ConnectSSH()
{
using (var SSHClient = new SshClient("myhost", "administrator", "mypassword"))
{
try
{
// Console.WriteLine("Trying SSH connection...")
SSHClient.Connect();
if (SSHClient.IsConnected)
Console.WriteLine("SSH connection is active");
else
Console.WriteLine("SSH connection has failed");
Console.WriteLine("Trying port forwarding...");
var portFwld = new ForwardedPortLocal("127.0.0.1", "127.0.0.1", 3306);
SSHClient.AddForwardedPort(portFwld);
portFwld.Start();
if (portFwld.IsStarted)
Console.WriteLine("Port forwarded: {0}", portFwld.ToString());
else
Console.WriteLine("Port forwarding has failed.");
}
catch (SshException e)
{
Console.WriteLine("SSH client connection error: {0}", e.Message);
}
}
}
}
Public Sub ConnectSSH()
Using SSHClient = New SshClient("myhost", "administrator", "mypassword")
Try
Console.WriteLine("Trying SSH connection...")
SSHClient.Connect()
If SSHClient.IsConnected Then
Console.WriteLine("SSH connection is active")
Else
Console.WriteLine("SSH connection has failed")
End If
Console.WriteLine(vbCrLf & "Trying port forwarding...")
Dim portFwld = New ForwardedPortLocal("127.0.0.1", "127.0.0.1", 3306)
SSHClient.AddForwardedPort(portFwld)
portFwld.Start()
If portFwld.IsStarted Then
Console.WriteLine("Port forwarded: {0}", portFwld.ToString())
' 'Dim dbConnect As DBConnect = New DBConnect(portFwld.BoundHost, "wcs_sch", "root", "dbpassword", "3306")
' 'Dim ct = dbConnect.Count("wcs_msg_host")
' 'Console.WriteLine(ct.ToString())
Else
Console.WriteLine("Port forwarding has failed.")
End If
Catch e As SshException
Console.WriteLine("SSH client connection error: {0}", e.Message)
Catch e As System.Net.Sockets.SocketException
Console.WriteLine("Socket connection error: {0}", e.Message)
End Try
End Using
End Sub
- 主要言語
- C#
- スター
- 4.4k
- フォーク
- 993
- 平均マージ
- 9日 21時間
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
sshnet/SSH.NET のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 67/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
azurenoops/spin_agent#975 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
dotnet/AspNetCore.Docs#37699 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
SubtitleEdit/subtitleedit#15108 · コメント 1 件 ·