LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

matrices index limits

I'm using LV 7.1. I would like to create a matrix for high dimension but I obtain a message like: "Not enouth memory to complete this operation". I'm using 2Gb ram pc, and the memory not pass 600 Mb. The minimum dimension for the problem on my pc is: 5000 x 6000 matrix of DBL. Can I avoid this LV limits? 
0 Kudos
Message 1 of 10
(3,384 Views)

Such big data structures are always a bit "difficult". Firstly you could check if you use the smallest possible datatype (e.g. U8 instead of U32). Secondly, and that's the problem most of the time, are copies of data. Check if there are unnecessary copies of your array - so for instance a local variable makes a copy.

Extract of the LV help:

Local variables make copies of data buffers. When you read from a local variable, you create a new buffer for the data from its associated control.

 

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 2 of 10
(3,382 Views)
Thank you for the answer. I simplifed the example and now I'm tring to initialize a matrix of double precision (I need this data type) for 5000x6000 matrix and LV don't work. I attach my example vi to this message. I tested the same vi in LV8.2 and i obtained the same behavior.
0 Kudos
Message 3 of 10
(3,377 Views)
I do not yet work with LV8.2. So if you could post it ast LV8.0 I can have a look at it.
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 4 of 10
(3,373 Views)
Hi Becktho,

in the example sujeep is just using an "Initialize Array" function with dimensions 5000&6000 and a 0 (DBL) as data input...

And yes, I also get the error message 'Not enough memory'. (WinXP, only 1GB RAM).
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 10
(3,371 Views)

I get the same error (WinXP, 1GB RAM).

Hm - simply calculated a DBL uses 8B => 8B * 5000 * 6000 = 240'000'000B = 228.8MB. Maybe there is a restriction in Windows so that a request for a datablock > X MB is not allowed. I don't now the caveats in MS memory management.

This could be something for our well-known professionals 😉

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
Message 6 of 10
(3,368 Views)
This may be a Windows issue. I ran the VI on my PowerPC Mac with 1 GB of RAM (OS X 10.4.10, LV 8.20) without an error. It takes over 30 seconds and the disk activity goes very high (15-50 MB/s) of read and write due to virtual memory swapping. LV had about 400 MB of physical memory allocated and 1.5+ MB of virtual memory. The computer had over 200 threads and more than 60 processes running.

Checking buffer allocations shows one buffer for the Initialize and one for the indicator. So you have two copies of the data. The Profiler showed 960 MB used by the VI.

Lynn
Message 7 of 10
(3,354 Views)

If I was able to download the LV evaluation version for Linux I would try it at home as well.

But obviously I am to dumb to get it from NI's website Smiley Mad

Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 8 of 10
(3,350 Views)

Hi All,

I digged it down a while.

Looks like the limitation is not in the datastructure itself but in the array indicator.
I'm adding a little piece of code that firstly allocates a matrix 5000x6000 of random double, than allows user to select a 4x4 sections of this matrix without having a 5000x6000 indicator.

I hope the code is clear enough.

Bye.

 

FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
Message 9 of 10
(3,326 Views)
Hi Stefano,

this is Filos example converted to LV7.1.

Message Edited by GerdW on 07-02-2007 10:26 AM

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 10
(3,323 Views)