C# 写的服务运行一段时间就崩溃了,日志显示 event 7031
xieqi 2009-05-26 10:48:10 怎样会引起event 7031事件?
这个服务一开始不会崩溃的,就是我加了一个
System.Threading.Timer m_Timer5 = new System.Threading.Timer(new System.Threading.TimerCallback(my_function5), null, 0, 3000);
就开始崩溃了。不定期,一天崩溃10次吧。这个程序都catch了错误,根本catch不到。原来的程序有4个这样的语句
System.Threading.Timer m_Timer1 = new System.Threading.Timer(new System.Threading.TimerCallback(my_function1), null, 0, 60000);
。。。
一直到
System.Threading.Timer m_Timer4 = new System.Threading.Timer(new System.Threading.TimerCallback(my_function4), null, 0, 60000);
都没问题。只是加了个m_Timer5 ,就开始崩溃了。
后来我把my_function5方法简化了,只有一个写静态文件的,打印当前时间,还是会不定期崩溃。
后来我把my_function5方法改成空方法了,就不崩溃了。后来我把循环时间改成20秒(原来是3秒),运行一晚上也没崩溃。
我遇到这问题不知道如何去找问题,只好一点点试,很郁闷。
推测应该和程序压力有关,这个是remoting服务程序,一样的程序装了10台机器,访问压力小的服务器,崩溃次数少,崩溃次数和访问压力成正比。
现在就不知道,怎么会引发event 7031事件。