Is there a way to prevent matlab from going into swap memory?

15 ビュー (過去 30 日間)
Craig 2011 年 10 月 10 日
Sometimes when working with new code I inadvertently declare an array or too many arrays such that matlab starts working in swap memory. Sometimes I can get matlab to respond and clear the memory, but most of the time I have to explicitly kill the matlab processes and restart matlab. So what I'm wondering is if there is a way to tell matlab to throw an error if too much memory is requested; kind of like it did back when I was using 32-bit matlab and it would give "out-of-memory" errors.


Walter Roberson
Walter Roberson 2011 年 10 月 10 日
Which OS?
If you are using Linux or Mac OS-X, then you can use the shell "ulimit" command before you start up MATLAB in that shell. You would, in that case, probably want to use the "-v" option of ulimit.
If you are using MS Windows, then I am not familiar with the mechanisms for that, but you could ask Clippy.
  6 件のコメント
Walter Roberson
Walter Roberson 2011 年 10 月 10 日
This _might_ help:


その他の回答 (1 件)

Jason Ross
Jason Ross 2011 年 10 月 10 日
Also, keep in mind with 64-bit computing and memory getting less expensive all the time, it may actually be appropriate to set the swap for a system to something that would be considered "too small". The old "1.5 - 2 times RAM" guideline may no longer be appropriate.

Community Treasure Hunt

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

Start Hunting!

Translated by