Hi All,
I have a memory leak when calling SMTPClient.Send.
Please help to fix it.
Hi All,
I have a memory leak when calling SMTPClient.Send.
Please help to fix it.
It is a very common mistake to assume that Taskmgr.exe is a leak detection tool. The combination of the .NET garbage collector and the Windows heap manager is far too sophisticated to be reverse-engineered from the numbers you see in that tool.
Proof it to yourself by sending thousands of email messages. If SmtpClient.Send() really leaks then your program will quickly crash with a OutOfMemory exception. Get more insight in the memory usage of a .NET program with Perfmon.exe and the performance counters in the .NET CLR Memory category. And a good book, like Richter's CLR via C#.