- Avoid plots with illegibly large amounts of data. The million-line plots and the box plots with millions of outliers are consuming large amounts of memory. For plots like those, MATLAB is probably creating millions of objects in a complex hierarchy, which decreases performance and uses lots of memory.
- Clear the plots that you are finished with in order to free memory along the way.
- If you encounter memory-related issues even after removing the memory-hog plots as suggested above, it may be helpful separate the simulation and plotting into distinct steps, shutting MATLAB down in between.
Matlab R2020b on Linux Lite CPU spiking.
1 回表示 (過去 30 日間)
古いコメントを表示
I've seen the same issue for other versions of Matlab and tried all of those fixes but nothing has worked.
Often when just plotting a figure the CPU spikes and Matlab freezes.
Any suggestions?
0 件のコメント
回答 (1 件)
Rishav
2024 年 6 月 7 日
Hi Naoise,
It is possible that the sheer volume of data being plotted is the root cause of the memory overflowing and CPU spikes. Please try the workarounds stated below:
The best way to do this is to start MATLAB from the command line, run your simulation, save its results, and exit. Then, for each plot, start MATLAB, load the results, create the plot, save, and exit. The link below explains how to start MATLAB from the command line:
You can use the '-r' option to execute MATLAB code. For example, you start MATLAB from the command line like so:
cd "C:\Program Files\MATLAB\R2020b\bin"
matlab -nodesktop -nodisplay -r "mySimulationScript; save('my_simulation_data.mat'); exit"
Please see the following documentation in order to address memory issues in MATLAB:
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!