Solution:
This behavior occurs in several different occastions which are listed below. Typically, it appears when dealing with very large data sets in LabVIEW. LabVIEW stores arrays, clusters, and waveforms in contiguous blocks of memory. The most common reason for this error is that LabVIEW cannot allocate a contiguous block of memory large enough for one of your arrays. For example, a 2000x2000 array of doubles would occupy approximately 32 MB. You may have more than 32 MB of memory free, but it may not be in a contiguous block. For reasons to solve this issue as well as reducing other memory consumers, please read the following suggestions below:
Reduce Memory use of Arrays, Clusters, and Waveforms:
- Use a smaller data type for your array. For example, if you only need to store integers in the range of 0 to 100, you can change the integer representation to U8, which would use 1/8 of the memory as compared to a double, which is the default type for numeric controls.
- In LabVIEW 8.5 and later, use the In Place Element Structure to access elements in an array, cluster, or waveform without create copies of the data type in memory.
- If the problem is isolated to graphing the data, there may a simpler approach. With a large array, you probably cannot see every data point when you plot it to a graph (you may have more data points than you have pixels on your screen). In this case, decimating the data would be appropriate for display purposes (for example, plotting every other point).
- Stream/write your data to disk, then perform analysis of your large datasets from disk in a high-performance analysis and reporting package such as NI DIAdem.
- Limit the number of times data is copied by reducing the number of global and local variables, indicators. This can be done by using producer and consumer loops and using references to data through the VIs named New Data Value Reference.
- Create SubVIs in order to break up the code into smaller pieces so LabVIEW can reclaim subVI memory when subVIs are not executing.
- With Larger subVIs, use the call by reference node so that the VI is called dynamically. When the subVIs are called dynamically, they will not be brought into memory until they are called. This will allow LabVIEW to have more memory on hand to use for the rest of the application.
- You can perform further analysis of a VI's memory usage using the LabVIEW 2009 Help: Profile Performance and Memory Window.
- For more information about how to change your code to improve memory usage, please refer toKnowledgeBase 2T9ICKTL: How Can I Optimize the Memory Use in My LabVIEW VI?
- Increase the amount of virtual memory on your system. The following link provides more detail:KnowledgeBase 2U4A7R6I: How Can Virtual Memory Help With Memory Issues in LabVIEW?
- With Windows XP 32-bit, LabVIEW can only use 2GB of RAM. In order to increase how much memory it could use, there is a .ini file that can be changed. For more information on how to increase this, please follow the link to KnowledgeBase 2HDEH9DT: How Much Memory Can LabVIEW Use?
'via Blog this'
No comments:
Post a Comment