Why does my long simulation slow down over time?
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Image Analyst
am 31 Okt. 2012
Jakob, do any of your operations display an image in an axes? If so, all of those images "stack up" in the axes control and sap memory. They're all in there even though you only see the top one displayed. Be sure to use "cla" before loading a new image in, and it will be faster, otherwise it will get slower and slower as more and more images get displayed.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!