LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do Tunnels Take Memory?

Do tunnels take memory ? Is there any advantage of reducing no. of tunnels in a code?

0 Kudos
Message 1 of 7
(4,314 Views)

Hi,

 

tunnels take memory. They take as much memory as needed to represent your variable, ie a double will take 64bit, a float 32 bit etc...

The reason that they take memory is that each input tunnel holds a copy of your variable, so that you can access the variable every iteration.

I do not think it is possible to reduce this memory allocation, but you can however use an inplace structure or force inplaceness.

 

best regards,

 

Stijn

0 Kudos
Message 2 of 7
(4,308 Views)

Actually I don't think the tunnel takes much memory. It is actually the wire and it's associated data type that uses memory. See here and here.

Now Using LabVIEW 2019SP1 and TestStand 2019
Message 3 of 7
(4,285 Views)

Well, if you use the show memory buffer locations as mentioned in the last of your links, then you would clearly see the buffer points at all tunnels. Hence, tunnels use memory and as much memory as needed to represent your variable(s).

 

Wires are only needed for dataflow, the compiler will completely disregard wires that go to 'nowhere' but will allocate memory for wires that end at input or output tunnels, wires that go into shift registers, etc...

 

best regards,

 

Stijn

0 Kudos
Message 4 of 7
(4,274 Views)

Yes I guess I mis spoke in a way. What I was trying to get across to the OP was that there are many other important things to consider when you looking at the memory footprint of an application.

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 5 of 7
(4,268 Views)

OP, please see

 

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/project/showinplace.html

 

This will show you where Labview has decided to create copies of the data.

Message 6 of 7
(4,242 Views)

No problem,

I was just answering the questions 'do tunnels take memory' 🙂 and not really thinking in a more general way. In any case, you are correct if you need to know the total memory footprint of your code, you must rely on other tools. However, the original post did not mentioned the target: FPGA, realtime, ARM, ...

 

best regards,

 

Stijn

0 Kudos
Message 7 of 7
(4,187 Views)