LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Gleichman

Option for turning off indexing for TDMS

Status: Declined

Any idea that has received less than 7 kudos within 7 years after posting will be automatically declined.

" ... when a TDMS file is open, LabVIEW will create an index structure in memory that is used for random access to the file. The built-in LabVIEW TDM Streaming API will always create this index, even if you're just writing." - Herbert Engels

This feature will cause an apparent memory leak if your program periodically writes to a TDMS file over a long period of time. 

 

Feature Request: 

Disable indexing option for "TDMS Open.vi"

4 Comments
Swimmer
Member

It's been a while since this was posted but I am doing this.  One sample writes to 16 channels once a minute with 640 groups.  Same channels in each group.  The groups are test step numbers.

 

Windows XP 32 bit over 6 days I experienced an out of memory error.

 

Switched to a windows 7 64 bit machine and ran for another 6 days and the memory usage didn't change beginning to end.  

 

I can't explain why. 

AndrewMc
NI Employee (retired)

I agree with the suggestion; that being said, I think there's a workaround that might work for you here.

 

TDMS 2.0 (http://zone.ni.com/devzone/cda/tut/p/id/9995) has several performance improvements, one of which will actually only write a new header if information changes; if a new header is not written, the internal cache does not need to be updated.  Therefore, in this situation, your memory leak would go away.  To take advantage of this improvement, install TDMS 2.0 linked at that bottom of the linked page (note: it comes installed with LabVIEW 2009, DAQmx 9.0 or later, CVI 2009, and similar products).  In your application, if you are writing waveforms to TDMS Write, note that some of the information changes (like t0) which will cancel out this benefit; therefore, if you are writing waveforms, I would recommend that you write a waveform the first call and subsequent calls just write the array data.  There's a "first call?" function in LabVIEW so that you can do something like this:

noheader.png

Thanks,

Andy McRorie
NI R&D
AndrewMc
NI Employee (retired)

Sorry for the confusion.  This workaround actually does not work in this case.  Apparently, there is still a memory leak even when only one header is used in the TDMS file.

 

The only workaround at this point is if you are using DAQmx.  That is, if you are just streaming to disk what comes from your DAQ card, you could just use the TDMS logging feature of DAQmx, which does not have this memory leak.

Thanks,

Andy McRorie
NI R&D
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 7 kudos within 7 years after posting will be automatically declined.