Showing results for 
Search instead for 
Did you mean: 

Memory problem?

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

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

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.

LabVIEW Champion Do more with less code and in less time
Message 3 of 5

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
Accepted by topic author AT1
11-18-2016 05:26 AM

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.

Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
Interesting in learning all you can about automotive CAN bus communication? Checkout my 12 part CAN Blog series.
Checkout and help contribute to the community driven LabVIEW Wiki.

Message 5 of 5