Query regarding matlab maximum allowed size of an array

3 views (last 30 days)
I need to assign more then 16GB array for which it is showing following error. (I am assigning using x = zeros(size)):
Requested 50000x50000 (18.6GB) array exceeds maximum array size preference (6.0GB). This
might cause MATLAB to become unresponsive.
Now I found created three different array with x = zeros(28000); which is approximately 6 GB for each. Even then also on assigning third array it is giving "Out of Memory" error.
I also tried using tall array as follows. But still it is giving of out of memory error
a = tall(zeros(28000));
I checked my system memory using memory command as follows:
>> memory
Maximum possible array: 8600 MB (9.018e+09 bytes) *
Memory available for all arrays: 8600 MB (9.018e+09 bytes) *
Memory used by MATLAB: 3256 MB (3.414e+09 bytes)
Physical Memory (RAM): 6100 MB (6.396e+09 bytes)
* Limited by System Memory (physical + swap file) available.
So, Is there any way to assign and perform calculation on more than 16 GB array?
  10 Comments
yash
yash on 9 Apr 2024
Okay, I understood I cannot have full array at a time in my memory due to memory limitation. My idea is I will read data in an in-memory array according to my available memory and rest of data I will dump in a binary file. Now, I need to extract a part of this file as and when needed from particular index. I see there are two options for doing this.
1) data store and tall arrays
2) memmapfile
So, for this application which is the best way of doing this and can you provide me one small example of doing this?
Rik
Rik on 12 Apr 2024
You are ignoring what we're telling you. You will need to write code capable of analyzing a small part of your data. Then you can process your full file in chunks. If you need help, you need to be explicit in what data you have and what output you want.

Sign in to comment.

Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!