I'm currently developing a .net windows service which is supposed to manage a number of FTP-connections to different FTP-servers. I am using the Xceed.Ftp.FtpClient for sending and receiving files and i am very pleased with the features in the xceed components. However i am having problems with increasing memusage over time. When the service has been running for exampel for 2 weeks and i look in the taskmanager it is allocating over 200 000 kB. After a number of different test to locate this memory leakage i now suspect the Xceed.Ftp.FtpClient. During an upload / download of a file the memusage increases in the program but it never seems to go down again.
Even if i run the simple example from below i have the same problem with increasing memory usage.
I am using VS2008 and the target framework is .net 2.0
Does anyone have a tip for me to get rid of this problem?
Best regards Fredrik Lindros
///////////////////////////////////////////////////////////////////////
Xceed.Ftp.Licenser.LicenseKey = "XXXX-XXXX-XXXX-XXXX";
Xceed.Ftp.FtpClient ftp = new Xceed.Ftp.FtpClient();
ftp.Connect("HOSTNAME", 21);
ftp.Login("USERNAME", "PASSWORD");
ftp.ChangeCurrentFolder("FOLDER");
System.IO.FileStream filestream;
for (int i = 0; i < 100; i++)
{
filestream = new System.IO.FileStream(@"c:\temp\PDF.pdf", System.IO.FileMode.Create);
ftp.ReceiveFile("PDF.pdf", filestream);
filestream.Flush();
filestream.Close();
filestream.Dispose();
}
ftp.Disconnect();
ftp = null;
///////////////////////////////////////////////////////////////////////