✅ 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
{
ClearingHouseFileName = _.Name,
DateCreated = _.LastWriteTimeUtc.ToString(),
FileSize = _.Length
}).ToList();
});
return files;
}
3 Replies
Buddy
Buddy2w ago
If memory leaks points to a library, then you should open an issue of their library or contact their support if it's not open source. Just make sure you dispose of everything
Unknown User
Unknown User2w ago
Message Not Public
Sign In & Join Server To View
MODiX
MODiX2w ago
If you have no further questions, please use /close to mark the forum thread as answered

Did you find this page helpful?