clear is solwer than writing
이전 댓글 표시
I have some code generating a large number of large arrays with a runtime of about 4 minutes (including a parfor loop). Memory consumption after completion is about 13 GB. However, when I run clear afterwards, it seems to take forever, so long that I've never actually waited it out (the longest time I've waited is twice the run time before exiting Matlab). How can that be? After all, during creation addresses and variables have to be written, whereas clearing only requires discarding the addresses. Seems a bit weird to me. If I just close Matlab, the workspace is "cleared" in a moment's notice.
Edit: I can't help thinking it must be some kind of bug. If i reduce the number of arrays by a factor of 10, clear takes just a few seconds (and is faster than the writing operation as one would expect).
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Profile and Improve Performance에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!