I am using the WinSCP .NET assembly in order to "monitor" on a FTP server, and download every file that is uploaded to the FTP server.
After leaving my program running all night, the ram usage was over 1gb, and after debugging and checking with profiling programs, it happened because of Session.Output
, which is an Enumerable collection of strings, which never gets cleared, and collects everything that happens to this Enumerable instead into a log file. I tried adding log file paths to Session.DebugLogPath
and Session.SessionLogPath
, which copied the Enumerable into a file, but didn't clear it.
How can I disable / clear the Session.Output
?