G
Guest
Hi,
We have find memory leaks when we tried to use timer to raise event at
specified
interval. The OS we use is: Windows XP Professional Version 2002, service
Pack 2,
IDE is: Visual Studio .NET2003. Microsoft .NET Framework 1.1, version
1.1.4322 SP1. To repeat this problem,
1. creat a VB windows solution
2. on the form, add a timer control, set the property interval to 100
3. add a button, name it "start"
4. add an event handler( command_click) to the button "start"
5. in the event handler, start the timer
6. watch in the "task manager", memory is prograssively increase,
7. to make this problem more clear, add another timer, set the interval to
10, again, when the button "start" clicks, start both the timer. this time
you probably will
notice the memory leaking faster, in 10 minutes, you will find it is leaking
around 1MB.
I tried to change the timer control to System.timers.timer, and use call
back functions at the specified interval, I have the same problem. Further
investigation into the memory leaking, we found if you put the thread into
sleep at certain amount of time, the memory leaks as well.
Is ther any one who knows why? This memory leak crashes our application.
I tried to force garbage colletion, things getting even worse.
Any suggestions are welcome.
Lihui
We have find memory leaks when we tried to use timer to raise event at
specified
interval. The OS we use is: Windows XP Professional Version 2002, service
Pack 2,
IDE is: Visual Studio .NET2003. Microsoft .NET Framework 1.1, version
1.1.4322 SP1. To repeat this problem,
1. creat a VB windows solution
2. on the form, add a timer control, set the property interval to 100
3. add a button, name it "start"
4. add an event handler( command_click) to the button "start"
5. in the event handler, start the timer
6. watch in the "task manager", memory is prograssively increase,
7. to make this problem more clear, add another timer, set the interval to
10, again, when the button "start" clicks, start both the timer. this time
you probably will
notice the memory leaking faster, in 10 minutes, you will find it is leaking
around 1MB.
I tried to change the timer control to System.timers.timer, and use call
back functions at the specified interval, I have the same problem. Further
investigation into the memory leaking, we found if you put the thread into
sleep at certain amount of time, the memory leaks as well.
Is ther any one who knows why? This memory leak crashes our application.
I tried to force garbage colletion, things getting even worse.
Any suggestions are welcome.
Lihui