09-02-2010 12:20 AM
Do tunnels take memory ? Is there any advantage of reducing no. of tunnels in a code?
09-02-2010 12:51 AM
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
09-02-2010
03:04 AM
- last edited on
04-28-2025
09:32 AM
by
Content Cleaner
09-02-2010 03:23 AM
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
09-02-2010 03:36 AM
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.
09-02-2010
07:13 AM
- last edited on
04-28-2025
09:33 AM
by
Content Cleaner
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.
09-03-2010 02:36 AM
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