We use Mail.dll to send emails and noticed a memory issue if we enable logging, the phenomenon is that memory use increases gradually and finally consumed full memory, we use DebugDialog tool to check memory and saw System.Char[]
object consumed large memory.
First, we comment out the Limilabs.Mail.Log.WriteLine
code(as we thought related to the way how we write log), but didn't work.
Then we comment out Limilabs.Mail.Log.Enabled = true;
code to disable logging, the memory became to normal and didn't increase gradually anymore.
So I think this is an issue of how Mail.dll handles log content and didn't release things properly?
using Limilabs.Mail;
using Limilabs.Client.SMTP;
public void SendEmail()
{
Log.Enabled = true;
Log.WriteLine += LimilabsLog_WriteLine;
using (Smtp smtp = new Smtp())
{
//...
}
}
private void LimilabsLog_WriteLine(string line)
{
//...
}