LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Will the memory leak for queue when used in producer and consumer mode in DAQ to transfer different sized array.

Solved!
Go to solution

In the data acquisition, I use one loop to poll data from hardware, another loop to receive the data from polling loop sent by queue.

 

But everytime the size of the transferred data array may not be the same, so the system may assign different array size and recycle very frequently.

 

Will it cost memory leak. Or will it slow down the performance, since the array size is not fixed, so every time need to create a new sized array.

 

Any suggestion or better method. 

0 Kudos
Message 1 of 3
(2,668 Views)
Solution
Accepted by topic author alex.

As i understand your description, your DAQ-loop acquires data with the setting '-1' for samples to read at the DAQmx read function. This results in the different array sizes.

Passing those arrays directly to a queue is valid and it does not have significant drawback in performance (at least as far as i know) and it definetly does not leak memory.

So the question is more or less:

Is it valid that your consumer receives different array sizes for analysis? How does your consumer handle those arrays? 

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 3
(2,657 Views)
The receiver will update them inot fixed sized shift registers, but also used some build rray function for color display for xy chart.
0 Kudos
Message 3 of 3
(2,641 Views)