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
 ArrayIndexOutOfBounds after long run
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jminer

3 Posts

Posted - 13 Nov 2006 :  17:06:06  Show Profile  Reply with Quote
Using QCRTGraph for Java; semi-real-time application drawing 6-10 waveforms; display update 1000 mSecs, sample update 10 mSecs. Works great for about 1 hour or so. Thereafter, I get an ArrayIndexOutOfBoundsException: 262144 at com.quinncurtis.chart2djava.DoubleArray.arrayCopy(DoubleArray:44)
...
... traceback through quinn curtis drawing
...
java.awt.EventDispatchThread.run

Eventually, I get a java out of memory crash.

Any suggestions?

quinncurtis

1586 Posts

Posted - 13 Nov 2006 :  17:26:04  Show Profile  Reply with Quote
Can you supply us with a simple example program using simulated data that reproduces the problem?

Are you continuously truncating the datasets, or are you accumulating millions of data points (10 traces * 100 samples/sec * 3600 secs/hour) = 3.6 Million datapoints/hour = 30MB/hour.
Go to Top of Page

jminer

3 Posts

Posted - 14 Nov 2006 :  11:17:53  Show Profile  Reply with Quote
The code I'm using is rather involved. I'm not explicitly truncating the datasets; I guess I assumed that was done behind the scenes, newbie error. I'm doing a run now with dataset truncation turned on:
autoTruncate=true
autoTruncMin=1000
autoTruncMax=200000

I will let you know how it turns out.

Thanks...Jim
Go to Top of Page

quinncurtis

1586 Posts

Posted - 14 Nov 2006 :  12:06:50  Show Profile  Reply with Quote
To keep the updates as fast as possible, keep the minimuim number of data points in the dataset only slightly larger than a screens worth of data. For efficiency, the maximum does not need to be more than 2x that, unless you want to be able to scroll back historically in the data. Your value 1000 for the minimum seems about right, the value of 200K for the maximum seems large unless you need access to all of the historical data values via the dataset.
Go to Top of Page

jminer

3 Posts

Posted - 14 Nov 2006 :  17:33:57  Show Profile  Reply with Quote
Good advice, thanks. The value 200000 was merely to get under the index 262144 where I seemed to get into trouble. A more reasonable value is definintely in order.

Update on last run: Setting up the truncation did the trick, no more crashes.

You folks have a great product and excellent support. I am impressed.

...Jim
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