.net - Memory leak while sending email -
I have a window service, which is configured to send email in the predefined schedule works with the schedule .Timers Timer and Timer_Elapsed every time I've picked Timer.Stop () the phone, sending emails (about every 1500 emails) every time, the next tick will be picked up, calculate the time and start the timer (calling timer.start () method) When the timer is over and the process starts sending email, memory usage increases but does not decrease after finishing when I call the function "not timed" application, then the process is complete to send The memory used after freeing is freed. Does anyone help me understand why this is going on? Maybe there is anything related to the thread used in the timer?
Thanks in advance.
There are some moral possibilities here.
-
The garbage collection is not kicked and there is no memory leak in it.
-
You are not using close or flush functions of the library
-
Your timer is starting a thread It does not end in any time, it is easy to see the process monitors and thread calculations.
The memory leak, in no way impossible, is impossible in .NET languages. Because JAT allocates memory and you need to actually check the need to clean all the things are not released in the code.
Without special details, I can not help better, especially do not know if you are doing file IO etc.
Comments
Post a Comment