How can I let MATLAB use all physical memory from my system?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 6 Nov. 2020
Bearbeitet: MathWorks Support Team
am 31 Jan. 2025
I observe "out of memory" issues when running certain commands in MATLAB.
For example, if I run
>> A = rand(1e5);
I get:
Error using rand
Requested 100000x100000 (74.5GB) array exceeds maximum array size preference. Creation of arrays greater than this limit may take a long time and cause
MATLAB to become unresponsive.
Looking at the "memory" command i get the following output:
>> memory
Maximum possible array: 3434 MB (3.600e+09 bytes) *
Memory available for all arrays: 3434 MB (3.600e+09 bytes) *
Memory used by MATLAB: 1129 MB (1.184e+09 bytes)
Physical Memory (RAM): 16158 MB (1.694e+10 bytes)
* Limited by System Memory (physical + swap file) available.
How can I get MATLAB to use all available memory from the system so that I do not run into Out of Memory Issues?
Akzeptierte Antwort
MathWorks Support Team
am 24 Jan. 2025
Bearbeitet: MathWorks Support Team
am 31 Jan. 2025
In order to do this, you can increase the System Swap Space. To learn how this can be done, execute the following command in the MATLAB R2020b command window to access the relevant documentation:
>> web(fullfile(docroot, 'matlab/matlab_prog/resolving-out-of-memory-errors.html'))
Additionally, you can adopt coding strategies for efficient use of memory. For more information on these strategies, run the following command in MATLAB R2020b:
>> web(fullfile(docroot, 'matlab/matlab_prog/strategies-for-efficient-use-of-memory.html'))
Please follow the link below to search for the required information regarding the current release:
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!