Why is Matlab slow with large objects in the workspace even when RAM is not limited?
조회 수: 22 (최근 30일)
이전 댓글 표시
I'm running Matlab on a machine with 200 GB of ram, yet Matlab slows down horribly when I store large (~10GB) objects in the workspace.
To test, I've tried running tic; 1+1; toc.
This snippet sometimes runs nearly instantaneously (as one would expect) but often takes minutes! I cannot discern a pattern in the runtime--it seems random. However, even when it runs slowly (5 min for example), toc still shows that it ran in milliseconds. While the command is running, I'm able to use the computer and Matlab normally (except the command window of course.)
Scripts also run extremely slowly.
How can I speed things up?
댓글 수: 1
David Goodman
2022년 12월 16일
I'm experiencing the same exact problem on Matlab 2021a with ~15 gig variable on 48g of ram...
채택된 답변
Philip Borghesani
2019년 1월 8일
Close the workspace browser or hide its tab. It may be that changing the workspace preference for calculating statistical values to a smaller number will help.
After running any code, but before returning to the command line, anytime a base workspace variable could have changed (usually scripts or commands) the workspace browser needs to refresh its list of variables, values and statistics including variable size. For large object structures or cell arrays this can take a long time to determine.
댓글 수: 0
추가 답변 (1개)
Steven Lord
2019년 1월 8일
Do you have the Workspace window open showing the properties of the large object? What happens if you close the Workspace window (leaving the object in the workspace, but not showing its properties) and rerun the tic / toc command?
댓글 수: 3
Erica Juliano
2021년 8월 10일
What do you mean by showing the properties? Right now I have my workspace windown minimized. Is this what you mean? Or is there something else I shouldn't be showing? It shows the "value" and "name".
참고 항목
카테고리
Help Center 및 File Exchange에서 Whos에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!