05-04-2011 11:06 AM
Hi all ,
I am using following VI to convert binary file into a CSV file with a specific formatting.
I am facing problems in deallocation of memory using this VI. I check the PF usage under performance tab of windows task manager before and after the VI runs. It takes up about 0.23 GB of memory even after I have shut the VI. Consecutive runs of the same VI result in 0.23 GB or less being added up again and again.
Is there a way to allocate memory and recover all of it back when the VI shuts down?
Thanks
Vivan
05-04-2011 11:34 AM
can you post your convert_array.vi?
05-04-2011 12:25 PM
Insert a "Request Deallocation" (part of the memory pallete) function into the VI.
It forces a memory deallocation upon VI exit.
05-04-2011 12:28 PM - edited 05-04-2011 12:29 PM
@Stranman wrote:
Insert a "Request Deallocation" (part of the memory pallete) function into the VI.
It forces a memory deallocation upon VI exit.
That, of course, is a band-aid solution. We would really need to look at the code of the subVI to see what it's doing.
Besides, the VI the user posted already has this function in it.
To poster: how big of a file are you trying to convert?
05-04-2011 12:31 PM - edited 05-04-2011 12:32 PM
Show us the missing subVI.
How big are the data structures?
What is your definition of "after I have shut the VI"? Do you do anything else after the VI has completed by itself?
Why do you use "request deallocation" if you plan consecutive runs?
Why are you using "init to default", why not just write the default value using a local variable?
05-05-2011 04:58 AM
Hi
Thank you all for ur help
Sorry about not posting the other covert array VI earlier.
The binary file is about 40 MB, this one is just a test file and could be bigger in future reaching upto 1 GB.
About 'after i have shut the VI', i check the pf usage under performance tab in the windows task manager. its is about 850mb before i run the vi for the first time. it builds upto 1.15GB during the run. I assumed that the deallocation memory vi would return me all the memory and bring back the pf usage to 850mb but it only returns 0.15GB. so the pf usage is 1gb after vi run. it remains around 1GB after each successive run.
is there a way to recover this 150 mb as well after each VI run?
Deallocation Memory VI - i tried putting using it in several ways. I made the sequences into subVIs and had the DelMem VI in each on of them. that didn't help either. i read some where that using a lot of DelMem VI could cause labVIEW to use more memory than required, so i just put one in last sequence box of the main vi.
I could try using local variable and post the results.
Thank
Vivan
05-05-2011 06:14 AM
i am also posting the new VI that I made, its the same thing with few minor corrections and no sub VI and this one doesn't work as well 😞
05-05-2011 10:07 AM - edited 05-05-2011 10:07 AM
@otiose wrote:
i am also posting the new VI that I made, its the same thing with few minor corrections and no sub VI and this one doesn't work as well 😞
Earlier, you said there are memory issues, but now you say it does not work. Which one is it?
Your code looks very inefficient and convoluted.
Do a "show buffer allocation" ald look at the inner loop. Looks like a leopard!
What is the purpose of the sequence structure?
Why are there two sequential inner FOR loops? Couldn't you do all in one?
You should open the file once, append in the loop using low level IO, and close at the very end.
Can you attach a small data file or include some default data in the VI and tell us the desired output. I think there is a very simple and direct way do do all this.
05-05-2011 10:56 AM
Hi altenbach,
The problem is same about memory issues. sorry for not mentioning it properly.
I could not attact the data file as it is in .bin format. I have changed the extension to .txt. It should be possible to revert back extension to .bin and use it.
The '.bin ' file is the data and I am trying to write it into csv file. the format for the csv file is working fine for me at the moment as in the attached file.
Yeah I know its a bit messy software. sorry! .. still learning!
Thanks
Vivan
05-05-2011 11:04 AM
Hi,
Just to put my problem in the picture. The memory issues causes the PF usage to build up. Please check the attached the picture.
This was the result of running the VI. I never get back the 11 MB difference. this difference increases when bigger files are used.
thanks
Vivan