랩뷰 메모리 부족 현상에 대해서

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P9mtSAC

Issue Details

When I am developing a large application in LabVIEW, I sometimes receive the following error message, even though I have a large amount of available RAM.

LabVIEW: Memory is full.
The top-level VI was stopped on the block diagram.
Refer to the VI Memory Usage topic in the LabVIEW Help for suggestions on monitoring and improving VI memory usage.


Solution

You typically receive this message when you are 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.

Use the suggestions in the following sections to prevent this message from appearing:

Reducing the Memory Arrays, Clusters, and Waveforms Use
  • If you have an array with a large data set, wire a smaller data type to the array, if possible. For example, if the array is a double-precision, floating point number [DBL] and you are storing integers in the 0 to 100 range, you can change the integer representation to Unsigned 8 bit integers [U8]. A U8 data type uses an eighth of the memory that a double-precision floating point number 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. Refer to LabVIEW Help: Memory Management for Large Data Sets for more information about max-min decimation.
  • 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 an application. Instead of using variables, you can create loops using a producer/consumer design pattern, or you can use the New Data Value Reference function to create a reference to the data.
  • Separate sections of code into subVIs to make memory available when the subVIs are not executing.
  • Use the Call By Reference Node to call large subVIs dynamically. A subVI is not in memory until a VI calls it dynamically.
  • Use the Profile Performance and Memory Window to acquire and display data about execution and data time. How Can I Monitor Execution Time and Memory Usage in My LabVIEW VIs?
  • Make improvements to the code to optimize memory usage. Refer to How Can I Optimize the Memory Use in My LabVIEW VI? for more information about memory optimization.
  • Use the NI LabVIEW Desktop Execution Trace Toolkit to identify problems that could negatively impact performance such as memory leaks and reference leaks; 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.

Increasing Memory in LabVIEW
 


Additional Information

This message is most common if LabVIEW cannot allocate a block of memory large enough for an array. For example, an array of double-precision, floating point numbers with 2,000 by 2,000 elements uses approximately 32 MB. Even if 32 MB of memory is available, you may not have a block of memory large enough for the array.
In the specific example seen above, this error is generated when an array containing more than 2^31 elements is used to index a For Loop. Arrays can contain up to 2^32 elements, but a For Loop can only index up to 2^31 values. This is because the N terminal uses the I32 datatype rather than the U32. The most significant bit of the I32 datatype is used to specify whether the value is positive or negative.

2024년 9월 13일 금요일 나의 투자 기록

 1. 사람은 각자의 고민이 있게 마련이다. 이게 어떤 조직을 이루고 있고, 많은 사람이 그 조직에 섞여 있으면서 각자의 고민이 조직에 영향을 주게 된다. 즉 문제가 발생하는 요인이 되는 것이다. 다른 사람의 고민을 감지하고, 고민을 알게 되었다면 2...