LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TDMS Write Memory Leak

Solved!
Go to solution

@Gleichman wrote:

Further Information:

 

TDMS Write

  • Group Name - String
  • Channel Name(s) - 1D Array of Strings
  • Data - 2D Array of Strings

I just rediscovered this problem and had already started a new topic here .  Based on the answer given by Herbert I had assumed that your problem was from keeping the reference open.  However, based on the fact that you are also getting the leak from writing string array data to multiple channels that is probably the cause of the leak.  Sad that this issue has been around since 2009 and it still isn't even recognized as a problem!  Thank you for discovering this and posting which helped me find a solution as well.  Anyone else with a TDMS leak issue look at the topic I linked to for a sample VI that demonstrates the leak.

Brian Gangloff
DataAct Incorporated
0 Kudos
Message 11 of 15
(1,373 Views)

@brian175 wrote:

  I just rediscovered this problem and had already started a new topic here .  Based on the answer given by Herbert I had assumed that your problem was from keeping the reference open.  However,  based on the fact that you are also getting the leak from writing string array data to multiple channels that is probably the cause of the leak.  Sad that this issue has been around since 2009 and it still isn't even recognized as a problem!  Thank you for discovering this and posting which helped me find a solution as well.  Anyone else with a TDMS leak issue look at the topic I linked to for a sample VI that demonstrates the leak.


The way I understand it, this is not really a leak per se, but simply the way TDMS works in order to build an index to the data. If the data is very fragmented that index gets large. Once you close the file refnum the memory is freed, so the classicial definition of leak simply doesn't apply anyways. Consolidation of data before writing it to disk in order to create less fragmentation is one way to help overcome or at least lessen this problem. Another one I would suppose is to defragment the file regularly between updates. It's not ideal I know, but there simply exists no ideal solution to data logging, that does not either require a potentially coninously growing index or rather slow read access as the read process seeks through the data on disk to find the right chunk. An option to disable building the index in memory if you know to only write the file, for sure would help here, but has it's own implications of users trying to use that option and then complaing if they try to do a read access later anyhow. And reading a fragmented file into memory for read access would create this index anyhow, so you might end up being able to write data to a file that you can't read without more memory available in the system than was needed to write it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 12 of 15
(1,317 Views)

rolfk wrote:

 

The way I understand it, this is not really a leak per se....


No this one is a real leak and now finally has a CAR, just follow the link to the other topic.

Brian Gangloff
DataAct Incorporated
0 Kudos
Message 13 of 15
(1,302 Views)

"In LabVIEW's Example Finder, there is an example called Memory Monitor that will acquire this data for you. The example finder is located under Help>> Find Examples. From here, search for memory and it is the seventh result. I hope this information helps you and if you need any more help please feel free to post"

 

Does the "Memory Monitor" example still exist for Labview 2016?  I am not able to find this in Help >> Find Examples

0 Kudos
Message 14 of 15
(841 Views)

I see Resource Monitor.vi but this thread is 5 years old and plenty has changed.  Windows 7 and newer come with the Resource Monitor and Performance Monitor built in for monitoring your system and are great debugging tools.

0 Kudos
Message 15 of 15
(827 Views)