Why does my long simulation slow down over time?
Mostrar comentarios más antiguos
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 comentarios
Star Strider
el 31 de Oct. de 2012
Are you running any solvers in your loops (ode, optimization, etc.)?
Jakob Sievers
el 31 de Oct. de 2012
Star Strider
el 31 de Oct. de 2012
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
el 31 de Oct. de 2012
Walter Roberson
el 31 de Oct. de 2012
Which MATLAB version are you using, and which operating system? 32 or 64 bit ?
Star Strider
el 31 de Oct. de 2012
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
el 31 de Oct. de 2012
Jakob Sievers
el 31 de Oct. de 2012
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre App Building en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!