.NET 4.0 System.Timers.Timer seems to not execute the elapsed event after some time

后端 未结 2 680
离开以前
离开以前 2021-01-06 04:37

I have a class that needs to run 24x7. It uses a Timers.Timer to execute an elapsed event in a calculated interval. After some time, 3-5 days, the timer just stops executing

相关标签:
2条回答
  • 2021-01-06 05:18

    Your threads have a problem. An explanation of what the specific counters mean.

    There should not be ~800 threads in your application(!). Furthermore they seem to be unable to completely start (for some reason). It could be resource exhaustion (probably memory). Heavy paging.

    Find out why there are so many threads. Maybe you are running lots of blocking work on many threads or posting many such work items to the threadpool.

    0 讨论(0)
  • 2021-01-06 05:20

    If your system real-time is not very strict, you try to

    if (next > 10)
            {
                return next;
            }
            else
            {
                return 10;
            }
    
    0 讨论(0)
提交回复
热议问题