06-09-2010 01:55 PM
Hi,
I keep on getting the "not enough memory" window popping up. I can run an process one or two files just fine, but after that I run out of memory. I use the deallocate memory function in my subVI's but when I open up the subVI's I can still se that the data is there.
Please help!
Thanks,
Patrik
06-09-2010 02:11 PM
mrsound wrote:Hi,
I keep on getting the "not enough memory" window popping up. I can run an process one or two files just fine, but after that I run out of memory. I use the deallocate memory function in my subVI's but when I open up the subVI's I can still se that the data is there.
Please help!
Thanks,
Patrik
You will have to unload the VI for the deallocate to do its thing.
But usually, it is better to fix the memory abuse issue.
Ben
06-09-2010 02:18 PM
Thanks,
How do you mean to unload? I have the subVI's set to close when they are done and my main program is stopped when a file is processed. I don't run into memory problems for the first one or two files, and I have really been working on the memory issue. I use a lower display frequency than the original sampling frequency and I use the deallocate memory function in all involved subVI's, and I try to be as memory eficcient as possible.
It doesn't make sense to keep the data from the first file in memory when I'm processing the second file. I want LabView to clear memory before loading the data from the second file..
06-09-2010 02:34 PM
mrsound wrote:Thanks,
How do you mean to unload? ...
If it is a sub-VI called by your main VI (or its sub-VIs), it is loaded into memory when the top level loads (See VI Hiarchy screen).
If it was called via VI server then you have to close the reference.
Rather than try to put duct tape on this memory link I suggest you try one of the following.
1) This tag cloud has a bunch of links realted toLabVIEW_Memory. Review all those tagged threads and figure out whcich situation applies to you.
2) Start a new thread "how do I reduce the memory used by a sub-VI" and post your code along with support files and detailed instructions. Somebody maybe be able to spot waht you are doing wrong.
Please don't feel like I am dissing you! managing memory in LV is subtle and if you don't have a background in operatings systems, it may be hard to get a handle on. In my case I have been prowling this forum for almost 9 years and I have read every posting by Greg McKaskle. ![]()
Ben
06-09-2010 04:15 PM
Sigh, I just want LabView to clear the data that is held in my SubVI's that I don't need when reading the other files anyway. As I said, it works fine for the first one or two files. The only work around now is to close my main program, open it again and then run.
The way my program works is that I click the run button and process one file. Then it stops and I click the run button again. If LabView could just clear the memory in between I should be fine.
Thanks
06-09-2010 07:42 PM
A few things are not clear from your description.
If processing a file is always similar, there should be no reason why the common subVIs suddenly would need more memory. You can actually make it worse by requesting deallocation if the same memory needs to allocated anyway at the next run.
How big are your datafiles actually? What is involved in processing? If you look at the memory use of the VIs, can you estimate how many copies of the data are allocated?
I suspect you have some inherent code problem, such as uninitialized shift registers or swarms of local variables. Another problem could be if you constantly resize arrays, thus requiring new allocations. Since arrays need to be contiguous in memory, you might run out of sufficient contiguous space due to memory fragmentation.
Could you explain what kind of processing you do? Do you mind attaching some code?