LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do I get a memory leak when I use the Write Data Storage VI in a loop

I have a large application that I am collecting various data points from. For the most part they are simple scalar values that need to be logged on a regular basis.  I was attempting to use the new TDM files and the storage VI's  I though everything was working until I looked at the taskmanager and noticed that when the logging loop ran my CPU eventually went to 100% and the process memory grew from about 80,000K to 100,000K and eventually locks up the system. 
 
I am using a state machine arch. 
 
State 1 - open file (open create) mode) 
State 2 - Write Channel Group Properties
State 3 - Loop writes 24 distinct data points to a TDM files in append mode
State 3 - Repeats [creating new rows of the same 24 data point (wait time about 1 sec)]
State 4 - Close file on exit.
 
Any help on this problem would be appreciated.
0 Kudos
Message 1 of 9
(3,310 Views)
Seems reasonable. Can you post an example which demonstrates the problem? If you have subVIs which are not part of vi.lib, then Save as... Development distribution and post the resulting .llb. Put some typical data into controls and save as default.

If we can see you VI, someone will probably be able to identify the problem.

Lynn
0 Kudos
Message 2 of 9
(3,298 Views)
I duplicated the code in a small application and it still demonstrates the same issue.  So at least I can make consistly bad code =).  Here it is.
0 Kudos
Message 3 of 9
(3,290 Views)
Unfortunately, the Storage VIs seem to be platform specific - to a platform which I do not have, so I cannot run the VI. Perhaps someone on a suitable platform will be able to help.

Lynn
0 Kudos
Message 4 of 9
(3,274 Views)
Thanks for giving it a try.  I am starting to think that I am missing something simple, but I just can pin it down.
0 Kudos
Message 5 of 9
(3,273 Views)
If you have ssp, the problem should be fixed next week.
I was able to recreate in both LabVIEW and in the RTE and see that NI is making progress at resolving the problem. 
7.1.1 profile

Paul
0 Kudos
Message 6 of 9
(3,265 Views)
The way I see it, it should be this way.

Message Edited by Pana-man on 09-30-2005 08:15 PM

Message Edited by Pana-man on 09-30-2005 08:18 PM


Paul
0 Kudos
Message 7 of 9
(3,265 Views)

Hi Bigguy,

This is an issue with the Data Storage VIs that we know about and have been working to correct.  As Paul implied, the issue was addressed in the recently announced LabVIEW 8.  I was able to run the VI that you sent without consuming the CPU.  In the meantime, you may want to look into the example code on the LabVIEW TDM Header Writer VIs which are useful for high speed data acquisition.  You can find them here:  http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=00AD0A77D3D5318CE0440003BA7CCD71&p_...

Good luck!
Megan B.
National Instruments

0 Kudos
Message 8 of 9
(3,217 Views)
Thanks guys for the help.  I got the same information through a contact at NI.  He provided me with some alternate code that essientially streams the data to file and simple creates the TDM header at the end of all acquisition.  The only downside to this method is that you are restricted to using one data type at a time.  This forced me to remove the strings that I had.  Fortunitly the strings that I used were limited and change very rarly, at most once an hour).  To handle this I simply created a seperate data file to record the string data and at the completion of the applciation I combine the two files. 
0 Kudos
Message 9 of 9
(3,210 Views)