Error of array exceeds maximum array size preference

8 views (last 30 days)
I am trying to create an array of a very large dimension in MATLAB. I am receving the following error:
'Requested 4290*65*4290*65 (579.3GB) array exceeds maximum array size preference. Creation of arrays greater than this Limit may take a lonfg time and cause MATLAB to become unresponsive.'
I have ran the code on a system with 8 core processor with 256GB RAM and on MATLAB2017 version.
I have ran the same code on a different computer system with 12 core processor with 128GB RAM and used the MATLAB2023b version on that system. With this system and this MATLAB version, I was able to generate the matrix of above mentioned size. Can anyone help with what exactly is the problem? Is it with the MATLAB version or the number of cores or it has something other issues?
  2 Comments
Stephen23
Stephen23 on 12 Mar 2024
"Can anyone help with what exactly is the problem?"
The error message tells us that you are trying to create an array which would require 579.3 GB.
Your computer has 128 GB of RAM.
Consider: can you store 579.3 liters of milk in a 128 liter bottle?
Shreya Chauhan
Shreya Chauhan on 15 Mar 2024
Thank you for the answer. The proble is code is working on 128 GB RAM system but not on 256 GB RAM system. We are looking for the reson behind this.

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 12 Mar 2024
Preferences -> Workspace -> MATLAB Array Size Limit
Turn off "Limit array size to a percentage of RAM"
Meanwhile, make sure that you have configured your system to permit lots of virtual memory.
... Expect response to be fairly slow.
  2 Comments
Shreya Chauhan
Shreya Chauhan on 15 Mar 2024
Thank you for the answer. We tried your solution but it is still not working and now it is showing Out of memoery insted of the previous error. Regarding virtual memory, I am not much familiar with that part.

Sign in to comment.

Tags

Products

Community Treasure Hunt

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

Start Hunting!