I'm trying to optimizing a program made of a model implemented in c++ and a labview interface. labview keep calling the dll saving and feeding back the result of the model. Now the c++ is huge and it's not optimized or well commented. My problem is this a variable is set at the first call of the dll and then never set again but is used. So it' look like to me like the dll reserve a space in the memory and keep using it. Is this correct? I thought that the dll work similar to a function that is called reserve memory use it, then as soon as it is done is close and the memory is use if needed for something else.
I attached the labview part