LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do these two Reshape Array operations result in a "Memory is full" error in LV86?

Solved!
Go to solution
The attached VI was saved in LV8.5.
It is a small piece of code that illustrates the way one of my applications uses to initialise two 2D-Arrays of DBL. Im my application the total amount of memory allocated by this VI is about 450MB (like in the attached VI) and the 2D-Arrays "live" in the shift registers.
Now I tried to check, if the application runs in LabVIEW 8.6 and it stops with a "Memory is full" error.
I isolated the problem to this small piece of code and it still doesn't run without an error.
Curious: The same code executes fine in LabVIEW 8.5.1, 8.2.1 and 7.1.1 ... So, where is the difference?
Regards, Guenter
0 Kudos
Message 1 of 15
(5,277 Views)

While I don't know what changed between version, it seem to run fine if you allocate outside the loop, e.g. as follows.

 

(You don't need the case structure, seqence structure, and the "first run?" primitive.)

 

 

(I agree there is something fishy. If you do execution highlighting, the memory error occurs once the data reaches the inner case structure boundary).

Message Edited by altenbach on 10-06-2008 12:03 PM
Message 2 of 15
(5,270 Views)

Right you are, Christian.

However, I need the data in an uninitialised shift register. (Therefore the "first run" and so on in my VI.) Basically, this VI is part of a data cache that allows to write and read data to and from it.

On the other hand: Reading the error message in LabVIEW 8.6 more carefully, I see: "VI ... was stopped at Case Structure".

Removing the case structure was a good approach to get rid of the error - but it doesn't solve my issue.

What else might be the reason for the misbehaviour. Or is there anything I should consider when moving to 8.6?

Regards, Guenter

0 Kudos
Message 3 of 15
(5,262 Views)

I agree there is clearly something wrong, and I suspect that there was a slight change on how memory is allocated in this specific case.

 

The buffer allocation dots look identical in 8.5 and 8.6, so it looks like a bug.

 

You should report this to NI.

 

(I placed a note in the monthly bug thread)

Message Edited by altenbach on 10-06-2008 12:39 PM
0 Kudos
Message 4 of 15
(5,249 Views)
Solution
Accepted by GuenterMueller

I agree this is strange and deserves more looking into. There is one workaround that seems to help that will not change the functionality of your code. Instead of using a While Loop and uninitialized shift registers, you can use feedback nodes and no while loop. The attached example has the same behavior as your code, but doesn't give an out-of-memory error.

 

It appears the only reason this works is not that I'm just using Feedback Nodes, but that I'm wiring the 2D array through from the Feedback Node to the Resize Array function, not a 2D array constant. If I wire it the other way, it fails the same way.

 

Example saved in LV86.

 

 

Message Edited by Jarrod S. on 10-06-2008 02:50 PM
Jarrod S.
National Instruments
Download All
Message 5 of 15
(5,241 Views)

Thanks for your note in the note in the monthly bug thread, Christian.

I just searched ni.com for a hint on how to report a bug but I could not find anything meaningful (except for ~4000 matches dealing with bugfixes). Is there an official link existing where bugs are usually posted?

Regards, Guenter

0 Kudos
Message 6 of 15
(5,239 Views)

Right you are, Jarrod. Using feedback nodes solves this issue. Thanks, Guenter

0 Kudos
Message 7 of 15
(5,233 Views)

Guenter Mueller wrote:

I just searched ni.com for a hint on how to report a bug but I could not find anything meaningful (except for ~4000 matches dealing with bugfixes). Is there an official link existing where bugs are usually posted?


To contact NI about a bug, look here. In the lower left corner (product feedback) is a "request support" link. Click it and choose e-mail support.

 

Of course the monthy bug thread gets scanned regularly by NI, so a quick liink there is probably sufficient unless you need to submit some proprietary code that should not be public.

 

It looks like Jarrod is on it already, so we're fine. 😄

0 Kudos
Message 8 of 15
(5,222 Views)

Good to know: "Request support" is the official way. (I have been there but did not intend to use it for a bug report.)

As Jarrod is now aware of this "feature" and the monthly bug thread too, I will not produce any further waste of information.

Thanks for your assistance.

0 Kudos
Message 9 of 15
(5,213 Views)

OK Jarrod's, solution works because newer labview versions have a "globally initialize" option that allows assigning a datatype to the shift register, something we cannot do in the original code if we wire across the reshape node.

 

However, there's a solution for that. If we add a "third" (dummy!) case that is never used except for defining the datatype of the SR, things also work fine with plain old shift registers. Try it!

It might be easier to modify your code this way. Less work, maybe! (just wire across the reshape node, add an extra case and insert "boolean to 0,1" after "fist run?" )

 

No more memory errors!!! 😄

 

Message Edited by altenbach on 10-06-2008 01:43 PM
Download All
Message 10 of 15
(5,197 Views)