LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to correct "Not enough memory to complete this operation" error using profiler?

I am a newbie to Labview and I have made a VI for recording voltage from a temperature module. The scaling is 0 to 10 VDC equals -200 to 300 deg f.  I have setup four channels and have two charts on the front panel, one for the stream of data and one for viewing the historical data. After about two hours of running I get the error "Not enough memory to complete this operation". I have read that I could use the profiler to find out what is going on but I can't seem to get anywhere with this. Can anyone help? I have attached my VI.
0 Kudos
Message 1 of 19
(14,118 Views)
Here is a screen shot of the profiler. I am not sure what to do with this data.
0 Kudos
Message 2 of 19
(14,113 Views)
Well, I'm thinking you may have stumbled across a LV issue.  I can get it to crash a lot faster than that when I clear your plot history in the top chart.  It definitely seems as though LV has a huge memory leak on charts having their history cleared.  With your 500,000 data point history, I lose about 170MB of memory every time I clear the chart history.

When I run your VI, the first time you plot data, I see a 170MB jump in memory, which I am assuming is the chart allocating its chart buffer.  But, then I continue to see more memory being used as more data is collected (if you don't use your default 1 sample a sec rate, you can see this happen much faster - I am using 5k sample rate and 5k samples).  Eventually, even without clearing the chart history, this will cause the system to crash.

I did a quick test and dumped the waveform and just used doubles and plotted that.  Memory usage is drastically better, as I see no memory leak during standard acquisition (I still see the memory leak when the chart is cleared however).

You may have to rewrite to not use the waveform and signal for your chart and just use DBLs.
0 Kudos
Message 3 of 19
(14,096 Views)
ok as I said I am a newbie, I ama not getting what you mean by just use DBL.
0 Kudos
Message 4 of 19
(14,090 Views)
On your DAQmx Read in your while loop, you selected Analog 1D Waveform (Analog->Multiple Channels->Multiple Samples->1D Waveform).

If you change that to Analog 2D DBL (Analog->Multiple Channels->Multiple Samples->2D DBL), you will use DBL (double precision reals) instead of the LV waveform type.  You will have to do something other than the express VI scaling, as you do not want the resulting signal type.  If you scale the DBLs, then you can plot the doubles on the chart instead of the signal.  I saw much better performance memory-wise with that data type.
0 Kudos
Message 5 of 19
(14,086 Views)
Another thing to consider is to start decimating your data or making your hostory shorter.  You put 500,000 data points for your history, and that's a lot of data.  At your 1x/sec rate, that's almost 6 days worth of history.  Since you effectively have a hostory viewer in your lower chart which looks at the saved data, do you need to store all that data all the time?  If you do, when you fill it up, you're going to have to zoom in pretty far to see individual data points.  So, if you decimate your data and start throwing out data points from your plot, then you can create a shorter history and your end user will not be able to tell unless he zooms in all the way.  But, with the bottom chart, they can see the dropped plot data from the data file.


Message Edited by Matthew Kelton on 11-25-2007 04:18 PM
0 Kudos
Message 6 of 19
(14,084 Views)
Ok I understand now about the DBL but when I do that I do not know how to proper scale it and get it into the chart. If I leave the express scaling VI in place or take it out completely, I still get nothing on the chart. Also the original error occurred not after a clear chart but just after two hours of running. I was wondering if I should add a request deallocation of memory to VI?
0 Kudos
Message 7 of 19
(14,077 Views)
The express VI is just applying y=mx+b.  So, you need to do that math, as the express VI wants waveforms.  You may need to right-click on the DBL chart and change the check value for Transpose array.

How did you get the error after running for 2 hours?  It hasn't even been 2 hours since you posted your response to me.

The memory deallocation will only work when the VI finishes running, so it will not help you here.
0 Kudos
Message 8 of 19
(14,072 Views)

The two hours occurred prior to my original post.

 

0 Kudos
Message 9 of 19
(14,069 Views)
I have changed to DBL (Still not scaled yet) and use a transpose 2D array to get the data to plot. However since it is not waveform data my historical chart is not properly displayed.
0 Kudos
Message 10 of 19
(14,060 Views)