LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Memory Issues

Hi,
 
I built the attached VI to take a binary file and convert it over to ASCII.  Problem is when I put a file that is 285 MB binary into it I get out of memory errors.  I was wondering if there was anything that I was coding
incorrectly in Labview which might be cause the program to take more memory than needed? I would appreciate any help.  BTW my computer stats are as follows:
 
1600 Mhz Pentium Dell Laptop
1 Gig of RAM.
 
 
Thanks a lot.
Intern NSWCCD Carderock.
0 Kudos
Message 1 of 4
(2,787 Views)
Any ideas? Thanks.
Intern NSWCCD Carderock.
0 Kudos
Message 2 of 4
(2,768 Views)
I can't open your VI because I have LV 6.1, but if you're converting a binary value (DBL is 32bit AFAIK , (or 64?)), you need to see how many characters the resulting conversion requires.  If your number is 3.147 in binary, it takes 4 bytes.  If it's in ASCII as "3.147000" it takes 8 bytes (8xchar).

Thus if you're converting numbers which require 8 digits in ASCII, your memory requirements are going to grow rapidly.  Maybe this is your problem.

Try converting and saving parts of the array at a time to avoid having to allocate so much memory at once.

And avoid data copying at all times.

Hope this helps

shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 4
(2,759 Views)

It makes no sense to read such huge data files into memory, convert it all to ASCII (ALSO in memory but using even more RAM). During run, you're easily topping GBytes starting with ~300MB ofbinary data!

Read your data in manageable chunks, convert, append to output file, wash, rinse, repeat until the entire input file is processed..

ALSO:

Please don't use string concatenation operations on paths, use "built path" and "strip path" instead.

You loop needs a small wait statement (e.g. 100ms). You don't want to spin the false case at full rate, consuming all CPU doing absolutely nothing.

 

0 Kudos
Message 4 of 4
(2,751 Views)