07-22-2020 09:59 AM
I want to have a 16*463360 array with SGL, but it always says the memory is full, what should I do?
07-22-2020 10:09 AM
@ericluo wrote:
I want to have a 16*463360 array with SGL, but it always says the memory is full, what should I do?
The number of bytes needed to fit that array is 29,655,040. You would need 64 bit LabVIEW at the minimum and a decent amount of RAM.
The other way to deal with an array of that size is to process in chunks of smaller size.
Don't have LabVIEW at the moment so can't look at your VI.
mcuff
07-22-2020 10:14 AM
Your test VI runs fine for me. What else do you have open and/or running?
07-22-2020 10:18 AM
@mcduff wrote:
@ericluo wrote:
I want to have a 16*463360 array with SGL, but it always says the memory is full, what should I do?
The number of bytes needed to fit that array is 29,655,040. You would need 64 bit LabVIEW at the minimum and a decent amount of RAM.
That is only 28.3MB (divide by 1024^2). No need to go to 64-bit for that.
07-22-2020 10:23 AM
@crossrulz wrote:
@mcduff wrote:
@ericluo wrote:
I want to have a 16*463360 array with SGL, but it always says the memory is full, what should I do?
The number of bytes needed to fit that array is 29,655,040. You would need 64 bit LabVIEW at the minimum and a decent amount of RAM.
That is only 28.3MB (divide by 1024^2). No need to go to 64-bit for that.
Thanks. That's what happens when I reply before my morning coffee.
mcduff
............................................________........................
....................................,.-‘”...................``~.,..................
.............................,.-”...................................“-.,............
.........................,/...............................................”:,........
.....................,?......................................................\,.....
.................../...........................................................,}....
................./......................................................,:`^`..}....
.............../...................................................,:”........./.....
..............?.....__.........................................:`.........../.....
............./__.(.....“~-,_..............................,:`........../........
.........../(_....”~,_........“~,_....................,:`........_/...........
..........{.._$;_......”=,_.......“-,_.......,.-~-,},.~”;/....}...........
...........((.....*~_.......”=-._......“;,,./`..../”............../............
...,,,___.\`~,......“~.,....................`.....}............../.............
............(....`=-,,.......`........................(......;_,,-”...............
............/.`~,......`-...............................\....../\...................
.............\`~.*-,.....................................|,./.....\,__...........
,,_..........}.>-._\...................................|..............`=~-,....
.....`=~-,_\_......`\,.................................\........................
...................`=~-,,.\,...............................\.......................
................................`:,,...........................`\..............__..
.....................................`=-,...................,%`>--==``.......
........................................_\..........._,-%.......`\...............
...................................,<`.._|_,-&``................`\..............
07-22-2020 12:09 PM
Works fine for me. While that's a big array, it should be peanuts for a modern computer. The random number function will output a double, one thing you can do is convert it to a single in the innermost for loop. That should cut the memory usage in half since you are not storing the values in an array of doubles before converting to single.
07-22-2020 05:06 PM
Some has been already mentioned:
The memory is not that much, but arrays need to be contiguous in memory so if your computer has been running for a long time with many things and you have e.g. tons of browser windows and other applications open, you might not have sufficient contiguous memory. How much RAM do you have and is your windows 32 or 64 bit? What does the task manager say?
Note that you'll have multiple copies in memory. While the array data alone is is only 29MB, the memory use for "data" is actually almost 10x that. (~300MB, see image), some used by various other structures (indicator, transfer buffer, etc.)
You definitely want to convert to SGL in the innermost loop, but my guess is that the compiler probably knows how to avoid the extra allocations, especially if debugging is off. (with debugging enabled, there will be extra code so you can e.g. probe the various wires).
@ericluo wrote:
... , what should I do?
The first suggestion would be to ask in the forum, but you already did that. 😉 Good!
The question now is what do you actually need? If this is a subVI and the data is needed for local processing, keep the front panel closed and disable debugging. Are you just playing around to see where the limits are or do you actually need that kind of data? What is it used for?
07-22-2020 09:11 PM - edited 07-22-2020 09:14 PM
RAM is 16GB, my window is 64bit, but the Labview is 32bit because I want to use Chinese language. I read data from SQL, which is 16*4633600, and i will call the array in the same VI.