How can I fix an Out of Memory error?

31 ビュー (過去 30 日間)
hadi
hadi 2015 年 6 月 22 日
回答済み: mahi foreview 2016 年 11 月 2 日
Dear All,
I am running a quite large code on my university supercomputer, and I keep getting the following error:
Error using cat
Out of memory. Type HELP MEMORY for your options.
Could you help me please?
Thanks in advance.
Best regards,
Hadi.

採用された回答

Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015 年 6 月 22 日
編集済み: Salaheddin Hosseinzadeh 2015 年 6 月 22 日
Hello Hadi,
Mainly you're running out of RAM memory.
You may have to modify your code to be able to run it. There are different ways of optimizing the code.
1- Reducing the number of variables. for instance, instead of creating new variables, use the already defined variables.
x = y + 2; % x is a new variable can be avoided
y = y + 2; % there is no permanent x here however y value is changed
2- Define variables as single prevision single() or int32 or .... This is going to help a lot with big matrices! You just have to be careful if this is changing the precision of your process. (there is no point to assign a double to define a variable like 32, int is enough). This also may cause you some complications, as some operations only support double precision. (try this it's very effective)
3- Use sparse matrix if possible.
4- Close other applications that are using your PC's RAM.
These are all that I can think of. ATM
Good Luck!
  3 件のコメント
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2015 年 6 月 22 日
Hi Hadi
One more point!!!!
You can clear the variables that you already processed and you don't need anymore.
x = y + 2;
clear y % assuming that you won't need y later.
;)
hadi
hadi 2015 年 6 月 23 日
Thank you very much for all your help and efforts.

サインインしてコメントする。

その他の回答 (3 件)

MANICKA SELVI M
MANICKA SELVI M 2016 年 3 月 18 日
can anyone say what is sparse memory?

MANICKA SELVI M
MANICKA SELVI M 2016 年 3 月 18 日
hai guys, i am doing the project feature enriched completely blind image quality evaluator. we have the code in our hand. we are clear with more concepts in code but we have some doubts in some concepts. cam anybody please clear those doubts

mahi foreview
mahi foreview 2016 年 11 月 2 日
hi, how to use image processing in simulink...

カテゴリ

Help Center および File ExchangeLogical についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by