LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do i get crashes when setting chart history length

I am trying to figure out how to get my chart to eat up less memory. At the moment it is capturing from 4 channels at 44100 samples/sec. It is a continuous capture and after a few minutes, the computer just runs out of memory and can no longer keep up with the capture, at which point the Vi quits. Opening up task manager, I noticed that as I capture, the memory gets chewed up really quickly, but when I stop my VI the used memory is not reclaimed. Even if I set the chart history to an empty array when the VI stops. I tried setting the chart history to a smaller number but whenever I set it below 512 the whole computer crashes.
0 Kudos
Message 1 of 5
(2,895 Views)
LabVIEW acquires memory in chunks and does not necessary return the memory when the VI is through running. You can have LabVIEW return the memory as soon as possible if you open LabVIEW >> tools >> options >> performance and disk.

Charts just update one value at a time on the right and push older data to the left. This older data is the chart history. The only way to minimize the data used by the chart is to minimize the number of data shown. I do not think the problem is with the chart history. We can check this by removing the chart from your program and running the code.

You can also run a trial test at a lower sampling rate or on fewer channels to see if you still run out of memory. If you still do, I suspect there is some structure (othe
r than the chart) in your program that is wasting resources.

How much ram do you have and what version of LabVIEW are you running?

Jeremy Braden
National Instruments
0 Kudos
Message 2 of 5
(2,895 Views)
Thanks for the reply. I have tried setting the performance and disk options to reclaim memory as soon as possible but it doesn't make any difference. I am pretty sure it is the chart using the memory, because as soon as I change the chart to a graph, the problem disappears. When I set the chart history length to anything below about 500, the machine always crashes. The machine has 128mb ram and is running Labview v6.0.
0 Kudos
Message 3 of 5
(2,895 Views)
What happens when you set the history to 1024 elements? Also will you get the leak when you run the program with the chart deleted?

I suggest creating an experiment where you simulate your data and write to the chart. If you see a leak with this VI, post it.

Jeremy Braden
National Instruments
0 Kudos
Message 4 of 5
(2,895 Views)
I have seen similar problems. I created a simple VI to test this and am continously getting LabView crashes when I try and write an intensity chart history to an array.
First frame of the vi sequence generates a 100 random number array for the intensity chart display. The next frame in the sequence has the property node for chart history (of the intensity chart)set to read mode and it is wired to a two deminsional array.
So, I generate psuedo chart data and then try to recover the history into an array. It crashes every time. No matter where I set the chart history length. I attempted to do as you had previously suggested and store the data to a file. Same response.... Crashes LabView. Local and online help have not been very hel
pful. Will search the hardcopy literature now.

thanx

WLS

Attached VI
0 Kudos
Message 5 of 5
(2,895 Views)