I have an application which listens to the serial port, processes the data and puts the extracted data on a large text box (which automatically scrolls to bottom).
The application even logs the same data in a text file (using FileStream - StreamWriter)
Over the time the CPU utilization starts increasing and after running it for 15 hrs its almost 100%.
I suspect the problem could be due to:
1.
these lines of code that executes every 250 mSec other than writing the same data onto a text file (after 15 hrs the log file size was 8 Meg)
2. FileStream - StreamWriter could be the problem although I highly doubt that
The application even logs the same data in a text file (using FileStream - StreamWriter)
Over the time the CPU utilization starts increasing and after running it for 15 hrs its almost 100%.
I suspect the problem could be due to:
1.
Code:
txtTraffic.AppendText(sTextToWrite); txtTraffic.AppendText(Environment.NewLine); txtTraffic.SelectionStart = txtTraffic.Text.Length; txtTraffic.ScrollToCaret();
2. FileStream - StreamWriter could be the problem although I highly doubt that
Comment