This is the expected behavior for TDMS Write in your application. Technically, this is not "leakage", this is memory usage increment, because if you use TDMS Close to close this file, the memory usage of the machine/target will be back to normal. The reason of the memory usage increment is that internal of TDMS, we need to keep some data structures for bookkeeping and while you write more and more data values, the internal data strucutre will also grow up. I understand the reason why you worried, and we also have a couple of walkarounds here:
I found Advanced TDMS file writing has a bug.
Look at the picture bug.png.
When I run that VI, Logical And is True. (of course, the two array are same).
Check bug2.png then you'll know what I meant.
Same input data, but one is broken, one is OK. So random.
Anyway, So If I keep open and close tdms, and open another tdms file....then It consume up my RT memory?
My procedure is following.
1. open tdms.
2. write data about 10000samples per 5 seconds.
3. keep writing 2 hours.
4. close tdms and open another tdms, then repeat from 1.
And then my memory is gone.
I attach againg my memory status log file.
You can see that last three times memory status is OK, I mean no more leak.
I just can't understand.
It's cool you find this "bug", TDMS Advanced Write doens't support "subarray", so you can find the wire is broken, but it supports "array". The workaround is quite simple, you can use "Always Copy" for the "subarray" before you wiring to TDMS Advanced Write.
I'm still confused how you generate the attached "Leakage.jpg", did you use any VI?
Attacked VI is almost same what I made that picture.
Just keep writing.....open tdms, write, close tdms..........
Thanks for your help & interest. 🙂
You are welcome.
Oh, you mean you used the 2 RT VIs in your attached picture, and write the results in a TDMS file?
Attached VI is running at my Real time target.
I get result via FTP.
Open tdms another VI run in my desktop and I see weird result.....
As you see that I log data and also memory consumption.
Then I get these patteren. Memory consumption like stepping up....
Sorry for the late reply, now let's try to narrow down the problem.
I would have the below suggestion:
Using the RT VI to record down the memory usage is a good idea, but please try to avoid write down the result into TDMS file. You could output the result directly in a waveform indicator or even TXT file. Firstly, do not use any TDMS node, just observe where there's any memory increment, and then using TDMS Standard API, to see what about the memory usage, and then using TDMS Advanced API to log the memory usage results.