Solution
This error message is typically encountered when developing an application with large data sets of arrays, clusters, or waveforms. Because LabVIEW stores each data set in a contiguous block of memory, the block of memory available on your computer might not be large enough to store a large data set. Another reason could be that lots of references are being opened and not closed properly.
Below are some suggestions to help prevent this error message from appearing:
Reducing Memory Used by Arrays, Clusters, and Waveforms
- If you have an array with a large data set, if possible, use a smaller data type to represent the items in the array. For example, if the items in the array are represented with double-precision floating-point numbers (DBL), but the range of possible expected values is limited to integers between 0 and 100, you can change the integer representation of the items in the array to unsigned 8-bit integers (U8). The U8 numeric data type uses an eighth of the memory that the DBL data type uses.
- In LabVIEW 8.5 and later, use the In Place Element Structure to avoid making copies of data when using an array, cluster, or waveform.
- If you are graphing data from a large array, use max-min decimation to avoid graphing every data point.
- Use the Profile Performance and Memory tool to help narrow down and identify which VIs are responsible for the memory usage.
- Analyze the large data set to determine where memory is full. Stream or write the data to disk and use a high-performance analysis and reporting tool, such as TDMS files, and NI DIAdem software.
Reducing Memory Usage in Applications
- To limit the number of times LabVIEW copies data, reduce the number of global and local variables in your application. Instead of using variables, consider using a producer/consumer design pattern, or the New Data Value Reference function to create a reference to the data.
- Separate large sections of code into subVIs and use the Call By Reference Node to call the subVIs dynamically. A subVI is not in memory until a VI calls it dynamically.
- Set large subVIs to non-reentrant when possible. Non-reentrant is the default setting for Windows and Real-Time VIs).
- Use the NI LabVIEW Desktop Execution Trace Toolkit to identify problems that could negatively impact performance such as memory leaks and reference leaks. The toolkit can also collect low-level information such as call chain, thread ID, and location in virtual memory of trace, as well as profile VIs, executables, and shared libraries.
- Reduce the polling rate of your front panel objects. If you are refreshing waveform graphs as quickly as possible, this could use a lot of memory. Reduce the polling rate to a user acceptable number.
Increasing Memory in LabVIEW
Closing References in LabVIEW
- When you open a reference to an application, project, VI, or other reference source, LabVIEW allocates memory to store that reference. To free up the space in memory where LabVIEW stored the reference source, you must close the reference. For more information, you can read more information on Closing References in LabVIEW