计时器控制内存消耗 [英] Timer control memory consumption
本文介绍了计时器控制内存消耗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用计时器控件每秒触发一个方法,在任务管理器中,我可以看到分配给应用程序的内存正在迅速变高.在计时器刻度中,我仅将一个字符串分配给用于测试目的的标签.
I''m using timer control to fire a method in every second and in the task manager I can see the memory which allocates to the application is going high rapidly.in the timer tick I''m only assigning a string to a label for the testing purposes.
private void timer1_Tick(object sender, EventArgs e)
{
if (label1.Text == "5")
label1.Text = "10";
else
label1.Text = "5";
}
private void Form1_Load(object sender, EventArgs e)
{
timer1.Start();
}
推荐答案
您完全确定Timer
是原因吗?尝试使用调试器.
Are you absolutely sure the Timer
is the reason? Try using the debugger.
这篇关于计时器控制内存消耗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文