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.
Solved! Go to Solution.
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.
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.
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.
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.