LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

it is the reason of memory?

When use "build array", I choose the length of array is 4M. The computer run too slow to end the program. I think it is because there is not enough memory. And when use "replace array", choose 16M, the same phenomenon come. There is 512M memory in my computer and I use 1MB/s to get the data.
Is there other method to save the usage of memory?
Thank you very much.
0 Kudos
Message 11 of 15
(763 Views)
OK, It all makes a bit more sense. You are changing datatypes twice on the big array causing many additional data copies. You MUST ensure that everything remains in I32.
 
Lets look at the buffer allocations in and assume a 4M I32 array (see numbers on Image).
  1. Allocates 16MB (4M x 4bytes)
  2. coerces it to DBL, causing allocation of 32MB (4M x 8bytes).
  3. Converst to waveform, allocating yet another 32 MB (4M x 8Bytes)
  4. The Waveform graph holds its own data, yet another 32 MB (4M x 8 Bytes) (at least!)

At the same time, you still need to run everything else, including the OS. 😄

Basically, your version with 4M I32 ends up gobbling up well over 100MB (and probably much more)! For the array data alone. It is also extremely expensive to keep many millions of points in a graph indicator. This is completely useless, because your graph indicator is less than 700pixels wide! You should perform data reduction and only display the relevant parts from the original array. (For some examples, look at the decimation section in the following application note:

Managing Large Data Sets in LabVIEW

Attached is a small code fragment to show how to streamline things. Even with a setting of 32M, it uses less than 400MB of data (Seems there are about 3 copies of the I32 array in memory).

Do you really need to divide by 16? Are you interested in the fractional part? You could do the division just with a right-shift, throwing away the fractional part. Alternatively, you just need to keep the raw data and adjust the y-axis scaling accordingly.

(I have not implemented any display decimation, but the above quoted application note should give you some pointers).

Message Edited by altenbach on 07-28-2006 10:08 PM

Download All
Message 12 of 15
(757 Views)
Dear altenbach,
Thank you very much.
My English is not good. So I don't know how to express my appreciation.
I can only say thank you again and again.
Thank you. Your vi is useful for me.
0 Kudos
Message 13 of 15
(748 Views)
I am sorry to say that I have a small question.
Comparing to  change the array to an waveform, and then send it to the graph, Sending the array to the graph directly,and set the XScale Multiplier. Although I have chosen the auto x-scale, when the length of data is less than 1s,such as 0.5s. The graph will not change its scale to 0-0.5 but keep is to 0-1,which make there is only half of graph is usefull.
Can the auto x-scale work properly?
Thank you!
0 Kudos
Message 14 of 15
(745 Views)
  1. RIght-click on the x-scale and turn off "loose fit".
  2. Change the formatting to show a few more digits of precision (You have this set to zero for some unknown reason).
Message 15 of 15
(738 Views)