•Created by jerry_without_tom on 5/26/2025 in #help
✅ Memory leak issue in Renci.ssh version (2020)
I am currently working on a project where files are retrieved from sftp using renci.ssh versoin (2020), I am currently facing memory leaks, which points towards the renci.ssh dll, could you guys help me with this.
public IEnumerable<FileTransferInfoModel> GetFiles(string serverLocation)
{
var files = new List<FileTransferInfoModel>();
_retryPolicy.Execute(() =>
{
using var client = new SftpClient(_connectionInfo);
client.Connect();
var ftpfiles = client.ListDirectory(serverLocation);
files = ftpfiles.Where(_ => !_.IsDirectory).Select(_ => new FileTransferInfoModel
{
ClearingHouseFileName = _.Name,
DateCreated = _.LastWriteTimeUtc.ToString(),
FileSize = _.Length
}).ToList();
});
return files;
}
public IEnumerable<FileTransferInfoModel> GetFiles(string serverLocation)
{
var files = new List<FileTransferInfoModel>();
_retryPolicy.Execute(() =>
{
using var client = new SftpClient(_connectionInfo);
client.Connect();
var ftpfiles = client.ListDirectory(serverLocation);
files = ftpfiles.Where(_ => !_.IsDirectory).Select(_ => new FileTransferInfoModel