人生是一场不能存盘的RPG,我只能尽量多搞几个Screenshot

June 16, 2006

不断调用System.Timers.Timer的Stop()和Start方法,会导致程序占用的内存和线程数骤增.

Filed under: .NET, My Questions

不断调用System.Timers.Timer的Stop()和Start方法,会导致程序占用的内存和线程数骤增.

System.Timers.Timer _tmr;

private void button1_Click(object sender, System.EventArgs e)
{
_tmr = new System.Timers.Timer();
_tmr.Interval = 10000000;
_tmr.Start();

while(true)
{
_tmr.Stop();
//Thread.Sleep(300); 如果使用了sleep,情况会大幅缓和,但线程数会增加.
_tmr.Start();
}

为什么?

May 15, 2006

什么样的连接对于IIS来说是一个Inactive的连接?

Filed under: My Questions

IIS会回收一个Inactive的连接所占用的资源.如果一个用户请求提交了一个非常耗时的请求,然后等待响应,这个请求对应的连接是否是Inactive的?






















Get free blog up and running in minutes with Blogsome
Theme designed by Hadley Wickham