Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCRTGraph for Java
 CPU getting maxed at 10 Hz
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

rlandfair

3 Posts

Posted - 16 Jan 2007 :  18:37:39  Show Profile  Reply with Quote
I have downloaded the Java real time graphing demo and was messing with the scrollapplication1 example you had. I added 4 more lines to it and a legend. I then decreased the timer eventTimer2 delay to 100 instead of 1000. My CPU processing went from ~40% to 100% slowly but did not come back down from 100% until I shut down the program. However, when I left the timer eventTimer2 delay at 1000 the processor stayed pretty consistent. We have a client that would like to see data at 10 Hz for 5 different plots on a real time line graph. Is there something that I need to do to keep the processor from being consumed? Is there a buffer I should clear out, should I manually call the garbage collection, or is there anything else I could try?

quinncurtis

1586 Posts

Posted - 16 Jan 2007 :  20:17:01  Show Profile  Reply with Quote
In any response please supply more information so that we can try and figure out how many data points/second you are actually trying to plot. We can't tell if you are trying to plot 100 points per trace, or 100,000.

1. You say you want the display update rate to be 10Hz. What is the actual sample update rate of the data, controlled by timer1 in our example ?

2. What is the extent of the graphs time frame, i.e. 10 secs, 5 minutes, 7 hours ?

3. From the time that you start running, how long is it taking to go from 40% CPU to 100% CPU usage.

4. Turn on the auto truncate capability of each RTProcessVar object your are displaying.

currentTemperature1.setAutoTruncateDataset(true);

run your program and answer question 3 again.


Go to Top of Page

rlandfair

3 Posts

Posted - 17 Jan 2007 :  13:12:09  Show Profile  Reply with Quote
Here is some more information and answers to our questions. I have put my answers in blue.

1. You say you want the display update rate to be 10Hz. What is the actual sample update rate of the data, controlled by timer1 in our example ? 100, which is what I want it to be

2. What is the extent of the graphs time frame, i.e. 10 secs, 5 minutes, 7 hours ? Indefinate.

3. From the time that you start running, how long is it taking to go from 40% CPU to 100% CPU usage. ~30 seconds

4. Turn on the auto truncate capability of each RTProcessVar object your are displaying.

currentTemperature1.setAutoTruncateDataset(true);

run your program and answer question 3 again. ~45 seconds

One other thing. I don't think the data is causing the problem, in eventTimer1, it seems to be the painting. The eventTimer2, which does nothing but call updateDraw() is what seems to be causing the problem. When the delay value is changed from 1000 to 100 is when the problem occurs. The CPU stays pretty stable at a 1000 millisecond delay. I think it will be okay to update the screen every 1 second, I was just wondering if it can be faster by changing something in the code.


Go to Top of Page

quinncurtis

1586 Posts

Posted - 17 Jan 2007 :  13:46:03  Show Profile  Reply with Quote
Based on the information you have provided, there is not much else you can do to speed it up. You can try and reduce the update rate to 500 msecs (2 Hz) to see if the CPU maxes out at something less than 100%.

Even though the graph updates at 1 Hz, it captures and displays all of the data being sampled at the 10 Hz (or faster) rate. We chose to decouple the data update from the display update, so that we can support samples rates many times faster than the update rate.



Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07