필터 지우기
필터 지우기

What might cause matlab to non-deterministically freeze up?

조회 수: 10 (최근 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 CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by