LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

the memory of an array 2000*2000 is greater than 32Mb

Hello,

I've programming an analyser of data and i have some problem with the Ram memory. I could isolate the problem; when I create an array 2000*2000 of double, the size should be 32MB but in my case the size is around 72M and when I create a 4D array 1*1*2000*2000 the size increases until 240MB!!

 

Thank you for your help,

 

cben.

0 Kudos
Message 1 of 20
(3,798 Views)

cben,

 

you forget that the compiled code has to handle the data as well as the UI thread. Therefore, LV copies all data which is being displayed in the frontpanel. Having typecasts included (coercion dots!) can easily pump up your memory usage to incredible numbers.

 

So please display only data you need, not "just everything".

 

hope this helps,

Norbert

 

PS: This link gives some hints on memory management in LV. Please note that there is a lot more stuff available on ni.com, manuals, this forum and LV courses from National Instruments.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 20
(3,784 Views)

Thank you!

 

To understand my problem, I've created a vi with only the build of the array 1*1*2000*2000 of double, even without the display of the result, i.e without indicator in front panel, the programm uses 240MB instead of 32MB theoric...

0 Kudos
Message 3 of 20
(3,774 Views)
Are you talking about the memory usage in the task manager for labview running your application or just the amount of memory consumed by just the vi?  If you are refering to the running memory usage of an application with just the array allocated there is also the memory required by either the runtime application or lv development environment which is expected to be significantly more.  Just as the memory to have an empty microsoft word page is going to be 100s of MB even though there is no document data.  what is the vi profile memory usage?
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 20
(3,770 Views)

falkpl,

 

I know about footprint memory consumption.

I just read running memory amount in task manager *before* allocating a big array, buf *after* running the application.

Then the delta after allocation if far away from theorical size (32MB of theorical data, about 300MB of allocated RAM).

I'm looking for reducing the gap between those values.

Please note I'm not using any UI components anymore to display data.

0 Kudos
Message 5 of 20
(3,760 Views)
I have a simple example where I allocate an 2000x2000x1x1 dble array prior to the allocation the memork usage is 158,640 and after is 189,952  or an increase of roughly 32mb (actually slightly less) less?).  I dont see this massive increase that you have noted.  Can you show a screen shot of the code where allocation is accomplished?
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 20
(3,750 Views)

Actually not slightly less but slight more.  There is a change 31312K and I would expect it to be 31250k (32000000B).

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 20
(3,747 Views)

With your vi, the RAM used for the allocation is 64MB, I don't know if it is just a coincidence but it is exactly the double...

 

 

I use the LV2009...

Download All
0 Kudos
Message 8 of 20
(3,737 Views)

DO NOT POST BITMAPS TO THIS FORUM. THERE IS A REASON THERE IS A BAN ON BITMAPS.

DO NOT CHANGE THE EXTENSIONS OF THE FILE TO GET AROUND THE BAN. THERE IS A REASON THERE IS A BAN ON BITMAPS.

 

I was going to help you, but I refuse to spend my time waiting for a 4 MB image to load into my browser when as a PNG it could be just a few hundred kB. And this from a person who's worried about memory usage!

0 Kudos
Message 9 of 20
(3,731 Views)

very sorry i'm blond!

 

Download All
0 Kudos
Message 10 of 20
(3,716 Views)