01-18-2010 05:03 AM
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.
01-18-2010 06:04 AM
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.
01-18-2010 07:05 AM
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...
01-18-2010 07:16 AM
01-18-2010 07:54 AM
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.
01-18-2010 08:27 AM
01-18-2010 08:35 AM
Actually not slightly less but slight more. There is a change 31312K and I would expect it to be 31250k (32000000B).
01-18-2010 08:57 AM
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...
01-18-2010 08:59 AM
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!
01-18-2010 09:09 AM
very sorry i'm blond!