MATLAB Answers

Use External Hard Drive for Memory in MATLAB

35 views (last 30 days)
L on 16 Nov 2019
Commented: TheStranger on 19 Nov 2020
I have installed MATLAB on an 2TB external Hard Drive. I am currently using windows 10. However, I keep getting "out of memory" error and when I checked which memory MATLAB is using, it is showing the memory information of my computer. Is there a way that I can use the memory of the external hard drive for MATLAB instead of my computer's memory? Also, can you share how to properly install MATLAB on an external hard drive ? I just want to make sure I did it correctly. Further, are there other ways where I can expand memory usage of MATLAB apart from expanding Java Heap memory and unchecking memory array size limit?
Thank you in advance

Accepted Answer

Walter Roberson
Walter Roberson on 16 Nov 2019
"Out of memory" is talking about RAM, not about hard drive space. One of your arrays is too large to be able to process with that algorithm in the amount of RAM you have, or you have an infinite loop that is using up all of the memory before it manages to give a recursion error.
Sometimes there are ways to use different algorithms. Sometimes you can use tall() arrays. Sometimes the only real cure is to add a lot more RAM.
It is possible to tell MS Windows to use virtual memory, that will use hard drive space as expanded memory. See But be warned that if you are swapping to memory, the program will often run 100 or more times slower than if it were able to fit in RAM.
  1 Comment
TheStranger on 19 Nov 2020
So good we have Walter Roberson who answers nearly all the tricky questions about MATLAB :)

Sign in to comment.

More Answers (0)




Community Treasure Hunt

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

Start Hunting!

Translated by