Hello, I am running into an issue where the runtime of each loop iteration increases when only opening and reading .mat files using the "MATLAB" data plugin. Attached is a VI replicating what we are seeing in a much larger analysis VI. It continuously opens the same .mat file and calculates the runtime. Opening task manager shows the memory slowly increase while the VI runs. As default, the VI's graph shows the results I got after stopping the while loop after 2002 iterations.
I have read that not closing the Read Data Storage can lead to memory leaks, which I have tried separating the Read and Close Data Storage parts with a Flat and Stacked Sequence Structure, but I keep getting the same error message (Error -2553). I don't understand why the error occurs since it is my understanding that these structures should execute the Close after Reading. Error also happens in the final iteration of a For and While Loop when the Close is outside the loop. Attached is a VI with these cases that I have tried.
I also attach a single .mat file to use to test.
Any help on this issue would be appreciated.