LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain Queue.vi error 2 after long execution, Labview 6.1

I have a program with several sections of block diagram running asynchronously, and so I'm trying queues for the first time in Labview.

After several days of running, I get Error 2 (out of memory/memory full) for "Obtain Queue.vi" inside a loop. I have checked, and the computer still has plenty of memory available, and the VI profiler shows no memory leaks in any of the VI's. I have also used W2K's performance profiler to confirm this.

Attached here is just the very basic structure (the full hierarchy is 100+ VI's) since I bet my error is a simple structure problem. Can someone spot what's wrong?

Thanks,
Jeremy
Download All
0 Kudos
Message 1 of 6
(4,464 Views)
Hi Jeremy,
I made a few changes to your code. Please try this out and see if it still gives your the error 2. If it is still not resolved, try downloading the evaluation version for the latest version of LabVIEW ( http://ni.com/labview )and give that a try. Please make sure you have a backup copy of your application if you use the evaluation version, so that you don't have to worry about converting your code from current to previous version of LabVIEW.

I hope this helps.

Sincerely,
Feroz
National Instruments
0 Kudos
Message 2 of 6
(4,464 Views)
No, if I could simply wire the queue reference to both sections of code, I would have. That code is just the basic structure, I "need/really, really prefer" to use Obtain Queue.vi for the full program. Also, this is still growing and I need to figure out what is the problem for future development.

I found the following on NI page "Differences Between Queues in LabVIEW 6.1 and Previous Versions":
"...for named queues, each call to Obtain Queue with the same name will result in a new refnum that points to the original queue."

So I guess there is some Labview-set limit to the number of refnums in memory, since the computer still has 97% free. I will try using Release Queue.vi within the loop as well as at program termination and report back.
Message 3 of 6
(4,464 Views)
Jeremy Marquis wrote:

> So I guess there is some Labview-set limit to the number of refnums in
> memory, since the computer still has 97% free. I will try using
> Release Queue.vi within the loop as well as at program termination and
> report back.

Yes do that definitely. I think LabVIEW has an internal limit of 2^16
refnums of any particular type, something derived from observing the bit
pattern of a refnum. Even if LabVIEW wouldn't have such an "artificial"
limit, each refnum requires memory, several bytes (could be in the range
of 16 to 32 bytes) in fact. So even if that refnum limit wouldn't exist,
you would run out of memory sooner or later if you keep opening refnums
without ever closing them.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 4 of 6
(4,464 Views)
RolfK wrote:

> Jeremy Marquis wrote:
>
>> So I guess there is some Labview-set limit to the number of refnums in
>> memory, since the computer still has 97% free. I will try using
>> Release Queue.vi within the loop as well as at program termination and
>> report back.
>
>
> Yes do that definitely. I think LabVIEW has an internal limit of 2^16
> refnums of any particular type, something derived from observing the bit
> pattern of a refnum. Even if LabVIEW wouldn't have such an "artificial"
> limit, each refnum requires memory, several bytes (could be in the range
> of 16 to 32 bytes) in fact. So even if that refnum limit wouldn't exist,
> you would run out of memory sooner or later if you keep opening refnums
> without ever closing them.


Even better would be to open the Queue refnum before the loop and close
it afterwords. Speeds up VI execution somewhat too.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 5 of 6
(4,464 Views)
Hi Jeremy,
I agree with Rolf's suggestion of taking the obtain queue outside the loop. Better efficiency and better memory management were the reasons why I removed the Obtain Queue from the while loop in the VI I had attached.

Please keep us posted on how the issue progresses. If none of this works, download the evaluation version of LabVIEW 7 (http://ni.com/labview) and see if that behaves similarly.

Sincerely,
Feroz
0 Kudos
Message 6 of 6
(4,464 Views)