How to control memory Allocation for Matlab?

10 visualizzazioni (ultimi 30 giorni)
Elsayed Abdelfatah
Elsayed Abdelfatah il 3 Gen 2017
Risposto: Walter Roberson il 3 Gen 2017
I was running my codes on my Dell laptop with 8 GB rams. Now I am running the codes on new Dell precision 7810 with 64 GB rams. however, the speed does not change. It seems like Matlab does not make good use of the available memory, or it's restricted a certain preallocated memory. Can anyone explain how to fix this issue and make the code running faster?
  1 Commento
Steven Lord
Steven Lord il 3 Gen 2017
Why do you believe memory allocation is the limiting factor in executing your code? If your code uses only 1 GB of memory but reads files from or writes files to disk, adding more memory probably won't impact the performance -- increasing the speed of your file I/O would. Similarly, if your code creates graphics your graphics card driver's performance probably has more of an impact on the performance of your code than your memory.
If you provide more information (or even better a small sample of code representative of your application) we may be able to offer some suggestions about what the bottleneck in your code is likely to be.

Accedi per commentare.

Risposte (2)

Jan
Jan il 3 Gen 2017
Obviously the 8GB machine has enough memory for your program. Then adding more RAM does not increase the speed.
Use the profiler to find the bottleneck of the program. If you post the relevant parts, suggestions are possible.

Walter Roberson
Walter Roberson il 3 Gen 2017
Steve Lord wrote: "adding more memory probably won't impact the performance -- increasing the speed of your file I/O would"
On some operating systems, you might be able to increase the size of the filesystem cache. That could improve performance if you are re-using files.
On OS-X (Mac), filesystem cache varies dynamically according to available memory (and perhaps due to other factors) so adding memory could help if files are being re-used. On the other hand, if specific files are being used often, it can sometimes be more effective to pin the files into cache or to use a RAM disk.

Categorie

Scopri di più su Environment and Settings in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by