Why does my long simulation slow down over time?
이전 댓글 표시
I am running long simulations involving a double for-loop with each approx. 20 intervals, and each internal process taking anywhere between an hour and a day. When initiating this simulation it will start off at a rapid pace, and will slow down at a rate which appears to be correlated to the decreasing availability of RAM on the computer. This, however, puzzles me as I have set it up so that nothing, apart from a handful of matrices, is stored in between the individual processes and all matrices are assigned before use so nothing grows without being pre-assigned.
Does anyone know of any tricks I can use? Is this just to be expected for long matlab runs in general? using tic/toc or profile only emphasizes that the whole thing slows down.
Thanks in advance
댓글 수: 8
Star Strider
2012년 10월 31일
Are you running any solvers in your loops (ode, optimization, etc.)?
Jakob Sievers
2012년 10월 31일
Star Strider
2012년 10월 31일
If you're taking matrix inverses (please do not use inv) or doing matrix division, how are you doing it? I suggest mldivide.
Jakob Sievers
2012년 10월 31일
Walter Roberson
2012년 10월 31일
Which MATLAB version are you using, and which operating system? 32 or 64 bit ?
Star Strider
2012년 10월 31일
The only other thing I can suggest is that you clear the matrices you no longer need at the end of an iteration or alternatively assign them to the empty matrix ( [] ), and re-allocate them at the beginning of the next iteration.
Jakob Sievers
2012년 10월 31일
Jakob Sievers
2012년 10월 31일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!