Issue Details
I have a large array of data and I want to be sure that I have only one copy of it in memory. I know that I can use a shift register and use the "Replace Array Subset" VI to keep a single copy. However, I need this to be a functional global. Since I can't initialize the shift register, I need a way to specify the type of array. If I use the "Initialize Array" VI within the loop, it creates another copy in memory.
To demonstrate the issue:
- Close all open VIs, but leave LabVIEW open.
- Create a new VI.
- Modify the Block Diagram to match the following images
- Open the Windows Task Manager and note the amount of memory that is being used by LabVIEW.
- Run the VI with the default settings and notice that the memory usage for LabVIEW increases by about 20 megabytes. The default setting for the dimension size results in an array of 1276900 double-precision numbers of 8 bytes each, which equals roughly 10 megabytes. Since there are two copies of the array, the memory usage increases by about 20 megabytes.
Alternatively, you can view the buffer allocations in LabVIEW by selecting
Tools » Advanced » Show Buffer Allocations. You should see one allocation at the shift register and another at the "Initialize Array" VI.