What might cause matlab to non-deterministically freeze up?

2 ビュー (過去 30 日間)
Ryan
Ryan 2014 年 4 月 13 日
コメント済み: Image Analyst 2014 年 4 月 14 日
Hello,
Thank you in advance for your help. I am running a very large job, and for some reason matlab keeps freezing up during its execution. Basically I am repeatedly calling the same function with different values and recording the results. The program is deterministic, that is, the same values are passed to my function in the same order each time I run the job. Therefore, if I have an infinite loop or some other kind of bug, any problem should be appear in the same spot each time I run the program.
When matlab freezes up, it is at different points in the execution of the function, and with different input values. Why might matlab be freezing up? I am keeping tabs on the progress of the job by printing how many times the function has executed to the console (it should execute the same number of times each time i run the job). Could this be causing matlab to freeze, or is possible that matlab has not frozen, but for what ever reason has stopped printing to the console?
It does not take very long for an individual function call to execute so I know after about 20 seconds of not seeing an update that matlab has frozen. One thing that I have noticed is that whenever matlab does freeze I will see this character "|" directly before, or there a bouts, the last line of output to the console. No where in my program is "|" printed to the console.
What could possibly be causing this?
  1 件のコメント
Star Strider
Star Strider 2014 年 4 月 13 日
Depends on what you’re doing. Numerically integrating a differential equation with singularities or extreme values in its solution could cause this.
The Debugger is your friend here.

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

回答 (1 件)

Image Analyst
Image Analyst 2014 年 4 月 13 日
Perhaps it running out of memory. Not sure what you're doing but maybe at the end of each loop try to clear out memory with lines like
clear('var1', 'var2', 'var3');
cla reset; % Get rid of "piled up" images or whatever.
  4 件のコメント
Ryan
Ryan 2014 年 4 月 14 日
I don't think so because, the amount of memory used by the program is very close to constant. The output of the function is a single integer value. In order for outside processes to be having an effect (I'm not running anything else) I would have to be very close to running out of memory and I really don't think that I'm any where near close enough.
Image Analyst
Image Analyst 2014 年 4 月 14 日
The only thing I can think of is to print what you're doing and see where it locks up.
fprintf('About to run function 1...\n');
function1();
fprintf('About to run function 2...\n');
function2();
fprintf('About to run function 3...\n');
function3();
See if it hangs at the same place every time and then try to debug it further once you know where it's hanging.

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

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by