Borrar filtros
Borrar filtros

How much Mac memory can Matlab utilize?

21 visualizaciones (últimos 30 días)
Michael
Michael el 16 de En. de 2024
Comentada: Walter Roberson el 17 de En. de 2024
I have a MacBookPro, with the M2 Max chip, and 96GB of RAM.
I have been shocked that some large memory-intensive computations I have been performing for years do not run much faster on this laptop than on a 10 year old intel iMac with far less memory.
Will Matlab R2023b utilize all free memory on the laptop, or does it adopt some upper limit of the memory it attempts to access?
I also tried testing the iMac versus the M2 Max laptop with a much simpler 'toy' number-crunching code that repeatedly takes the inverse of a 1,000 by 1,000 matrix.
Here is the M2 Max run using R2023B, supposedly a native Apple silicon version of Matlab
>> m=1000; n=1000; tic; for i=1:m, A=randn(n,n); B=inv(A); end, toc
Elapsed time is 36.986920 seconds.
Almost the same as running the same command on a Late 2012 iMac (intel)
>> m=1000; n=1000; tic; for i=1:m, A=randn(n,n); B=inv(A); end, toc
Elapsed time is 38.338430 seconds.
I get a similar lack of speed-up if I set n=2000, and repeatedly invert 2,000 by 2,000 matrices, or even larger matrices. I find this lack of performance increase rather strange.
MB
  1 comentario
John D'Errico
John D'Errico el 16 de En. de 2024
Note that 2K by 2K matrices are literally tiny, not stressing the memory you have on that computer in the least.
2000*2000*8/1024^3
ans = 0.0298
so 0.03 gigabytes per matrix. Your computer is laughing at you.

Iniciar sesión para comentar.

Respuestas (2)

Walter Roberson
Walter Roberson el 16 de En. de 2024
Will Matlab R2023b utilize all free memory on the laptop, or does it adopt some upper limit of the memory it attempts to access?
Preferences -> Workspace -> MATLAB Workspace Preferences -> MATLAB array size limit -> [ ] Limit the maximum array size to a percentage of RAM
Untick that so that MATLAB will be willing to request more memory than there is physical memory, which could cause swapping to disk.

Image Analyst
Image Analyst el 16 de En. de 2024
Try this:
>> memory
in the command window.

Categorías

Más información sobre Just for fun en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by