MATLAB Answers

Use External Hard Drive for Memory in MATLAB

35 views (last 30 days)
L
L on 16 Nov 2019
Commented: TheStranger on 19 Nov 2020
Hi,
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 https://www.geeksinphoenix.com/blog/post/2016/05/10/how-to-manage-windows-10-virtual-memory.aspx 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
TheStranger on 19 Nov 2020
So good we have Walter Roberson who answers nearly all the tricky questions about MATLAB :)
Thanks!

Sign in to comment.

More Answers (0)

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by