Jan*_*gge 5 .net c# memory-management timer winforms
任何人都可以解释为什么这个小应用程序的内存使用量不断增加?
static class Program
{
private static System.Timers.Timer _TestTimer;
[STAThread]
static void Main()
{
_TestTimer = new System.Timers.Timer();
_TestTimer.Interval = 30;
_TestTimer.Elapsed += new System.Timers.ElapsedEventHandler(_TestTimer_Elapsed);
_TestTimer.Enabled = true;
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
static void _TestTimer_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
string test = "tick";
Trace.WriteLine(test);
test = null;
}
}
Run Code Online (Sandbox Code Playgroud)
谢谢!Pika81
| 归档时间: |
|
| 查看次数: |
2591 次 |
| 最近记录: |