Matlab R2020b on Linux Lite CPU spiking.

2 visualizzazioni (ultimi 30 giorni)
Naoise Holmes
Naoise Holmes il 26 Feb 2021
Risposto: Rishav il 7 Giu 2024
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?

Risposte (1)

Rishav
Rishav il 7 Giu 2024
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:
  1. 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.
  2. Clear the plots that you are finished with in order to free memory along the way.
  3. 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.
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:

Categorie

Scopri di più su Measurements and Feature Extraction in Help Center e File Exchange

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by