LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

open txt file increase memory usage

Hi

I have a problem.
I'm opening a txt file, transform its data in an array and write some data of ths array in a table.
I don't use any local variable. all collected data are passed trough in sequences.
BUT: when I open a 20MB file the memory is increased of 70MB. And what it makes extremely bad for me is that the memory isn't deallocated anymore. Only when the vi is close.

Are there any suggestions?
Thanks for all help.


Yves

LV8.2.1
0 Kudos
Message 1 of 7
(4,030 Views)

Yves,

Can you pl post a screenshot of your code ?

I m down in the pit in 7.1. Smiley Sad

I ve handled tens of KBs of txt files in my project without any fuss, max upto 80-82 KB.

Moreover, I use the Request Deallocation function from the Advanced pallette, once I read back the data from the desired file, and also at the finish of the VI.

Did you try it out ?

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 2 of 7
(4,020 Views)
Parthabe,

Thank you for your help. I've attached my example in LV 7.1

I guess the problem might be solved with the "Request Deallocate" function. I was looking for such a function but searched it in the File pallette

Yves
0 Kudos
Message 3 of 7
(4,007 Views)
Hi Yves,

suggestions:
1) Don't use sequences. Use a flat one when really needed!
2) Why do you have multiple inputs into the sequence for the same control?
3) Use the menu option Tools->Profile->Show Buffer Allocations! You will see small black dots whenever LabView has to allocate new memory blocks. In your case there are so many allcotions... That's why your vi needs 70MB RAM for a 20MB text file!

I made some cleanup to your vi. The two case structures can be merged into one as they handle the same cases...
Read the development guidelines, PLEASE!

Message Edited by GerdW on 05-10-2007 10:02 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 7
(4,003 Views)

And GerdW forgot to attach the LV Style Guide... Smiley Wink

http://www.ni.com/pdf/manuals/321393d.pdf#labview_style_guide

- Partha ( CLD until Oct 2027 🙂 )
Message 5 of 7
(3,981 Views)
Thanks for all your help

My final version looks like this now. I hope it's in accordance with LV rules. (I have also set a deallocate in the Vi which reads the data)

Yves
0 Kudos
Message 6 of 7
(3,960 Views)

Hi Yves,

Now, see for yourself how clean & neat the code looks ! Smiley Happy

Nice work. Keep it up.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 7 of 7
(3,933 Views)