Help me on system slowing down on plotting as 1hz signal!

  • Thread starter Thread starter Beorne
  • Start date Start date
B

Beorne

I have a Windows Form application written in C# on CF in a system with
WindowsCE operating System.

The application shows a plot of a signal (now an int randomly
generated). It updates this plot on a Panel every second.
After a hundred seconds the system slows down and the form became not
responsive.
I think it is not a memory problem because I'm showing the used memory
with GC.GetTotalMemory(false) and it is not near filling.
In the constructor initialization I hook the handler to the timer event
i added with the project editor

timerMain.Tick += new EventHandler(TimerEventProcessor);

private void TimerEventProcessor(Object myObject, EventArgs
myEventArgs)
{
// 1: generate new number
// 2: add new number to a List of points of the Panel
// 3: call invalidate on the Panel
}

In the OnPaint of the panel I have all the drawing (a set of DrawLine
from point to point)

What should I look?
Thanks.
 
is the timer disabled in its event?

// 0: timerMain.Enabled = false
// 1: generate new number
// 2: add new number to a List of points of the Panel
// 3: call invalidate on the Panel
// 5: timerMain.Enabled = true
 
Well showing us the code would probably be useful, as you probably have a
bug. Are you Disposing all graphic objects when you're done with them?
 
I've found the stupid bug and now all is going smoothly.

But please tell me which are te graphic objects i should manually
dispose (I don't use file handlers or db connectionns or remote
connections up to now). The only thing I dispose now is a .bmp with a
logo.
 
Back
Top