LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory problem?

Solved!
Go to solution

I'm taking a temperature reading every second for 10 hours.  The temperature is a double.  Each temperature reading is stored in a cluster with the current timestamp.  All this data (36000 clusters) is stored in an array of clusters.  Occasionally, my program will lock up.  Is there a  way to determin if I'm having a memory problem?  Is there a size limit for arrays in LabVIEW?  Thanks in advance.

0 Kudos
Message 1 of 5
(3,293 Views)

Can you share your code? Do you pre-allocate an array of 36000 elements, or are you constantly adding one new element at a time? In either case, an array of 36000 elements is fairly small and shouldn't cause you to run out of memory, but it's definitely preferable to pre-allocate the array if you know the maximum size it will need to be.

Message 2 of 5
(3,291 Views)

Does it lock up permanently or temporary. Any error messages?

What is the memory use in the task manager?

Are you trying to display all data on the front panel?

 

Yes, you should preallocate the entire array once, but you haven't shown any code yet.

 

How much precision do you really need for the time an temperature. I doubt you need the 64 bits of dbl for the temperature or 128bits of a timestamp.

Message 3 of 5
(3,255 Views)

These suggestions give me something to work with.  I can't share the code due to the nature of the business.  The array is not pre-allocated.  Each temperature reading is appended to the array using a Build Array function and a shift register.  Every second, the new array contents are displayed on an X-Y graph.

0 Kudos
Message 4 of 5
(3,212 Views)
Solution
Accepted by topic author AT1

I think the first solution might be to look into preallocating that array.  It isn't giant, but it is on the larger size.  Initialize the array with the number of values you expect to have, and initialize it with the double NaN.  This will make graphing it ignore these points.  Then perform a replace array subset at the indexes when you take the measurements.

Message 5 of 5
(3,178 Views)