Matlab and 'sandbox' process Peak CPU Usage in macOS Big Sur

18 vues (au cours des 30 derniers jours)
Joao Nizer
Joao Nizer le 23 Juin 2021
Commenté : Walter Roberson le 31 Jan 2023
Matlab version: 9.10.0.1684407 (R2021a) Update 3'
System Version: Big Sur 11.4 (20F71)
MacBook Pro: (13-inch, 2020, Four Thunderbolt 3 ports)
Processor: 2 GHz Quad-Core Intel Core i5
Memory: 16 GB 3733 MHz LPDDR4X
Graphics card: Intel Iris Plus Graphics 1536 MB
Problem:
In the image bellow I pressed command+return to run the code and the sandboxed process started to peak. This happens all the time while using matlab. Sometimes even when just typing in in the code editor. I even tried closing all other applications in the system and run just Matlab, the problem persisted.
From time to time the sandboxd process peaks CPU usage and the entire Matlab becomes laggy, impossible to use. It is a recurrent problem. I tried installing 2020b version, but same thing happened. I'm not using Magnet or other window snaping tool.
I've sent a feedback to Mathworks under this identifier when it happened to froze once, forcing me to quit the application: Help troubleshooting recent MATLAB crash: 04938298 ref:_00Di0Ha1u._5003q1PuOu8:ref

Réponse acceptée

Walter Roberson
Walter Roberson le 23 Juin 2021
This is a known issue in Big Sur 11.4 for M1.
I notice that you are not using M1; it is plausible that the same underlying problem is responsible (whatever that problem is.)
People have been reporting that R2021a Update 3 helps; I see you are already using that.
There is a bug report that indicates that some people may need to start MATLAB from Terminal to prevent crashes.
  7 commentaires
Jonathan Mynard
Jonathan Mynard le 19 Jan 2022
I am having the same problem but starting from the terminal does not solve it. (Using Mac Big Sur with Intel chip, R2021b and R2022a prerelease)
Jeremy P
Jeremy P le 10 Déc 2022
Walter, any update on this issue? I'm using 11.7.1, matlab R2022b, Mac Pro with intel chip. Hoping to not go the route of Tim Lueth described below, but need a solution, thanks

Connectez-vous pour commenter.

Plus de réponses (4)

Raphaël Nussbaumer
Raphaël Nussbaumer le 11 Déc 2021
Kill this process was the only solution which worked for me. I'm having to do that roughly every 30min.

Tim Lueth
Tim Lueth le 29 Déc 2021
Modifié(e) : Tim Lueth le 29 Déc 2021
The problem occurs frequently, even in 11.6.2 (Big Sur) with 2021b. I agree with Raphaël Nussbaumer that stopping the spindump task fixes the problem. For me, it occurs when the editor window is clicked from the command window or a file is opened with a double click, on OSX (MacBook Pro (13", 2020, 2.3 GHz quad-core Intel Core i7, 32 GB 3733 MHz LPDDR4X)

Matthew Johnson
Matthew Johnson le 29 Avr 2022
I'm not sure if what just worked for me will work for everyone -- it sounds like there could possibly be several closely-related variations on the same issue. But my 2021b was hanging on startup similar to what others were getting. I tried launching from the command line without the desktop running ( /Applications/MATLAB_R2021b.app/bin/matlab -nodesktop ) and then running the desktop command from within the terminal. When I did that, I got an error message about my desktop layout configuration XML file being corrupted, and that MATLAB was going to use the default configuration. I went ahead and re-positioned my window and panes, and then exited MATLAB and restarted the usual (non-command-line) way, and it started up just fine (and it appeared to have successfully saved my desktop layout). Again, not sure if others are having the same issue for the same reason, but perhaps this will fix some cases?
  1 commentaire
Tim Lueth
Tim Lueth le 8 Juin 2022
I have tried this. Unfortunately, it did not help to fix the spindump/sandbox problem on 2021b and OSX10.16.

Connectez-vous pour commenter.


Tim Lueth
Tim Lueth le 6 Déc 2022
Modifié(e) : Tim Lueth le 9 Déc 2022
Since I use Matlab on an Apple Mac every week in lectures, I was tired of having this problem several times each week in front of hundreds of students! There is no warning but Matlab slows down and slows down and finally "stands" without error message. Especially for functions or scripts that run for several seconds or minutes, detection is very difficult, time wasting and switching to the terminal program and entering the superuser password is unprofessional.
The solution works in four steps:
1st: Find the PID number of the sandbox process and the spindump process
[a,b]=system(sprintf('ps auxww')); c=strsplit(b,char(10))'; d=c(contains(c,'/usr/sbin/spindump','IgnoreCase',true)), e=split(d);
if ~isempty(e); PID1=e{2}; else PID1=[]; end;
% [a,b]=system(sprintf('ps auxww')); c=strsplit(b,char(10))'; d=c(contains(c,'/usr/libexec/sandboxd','IgnoreCase',true)), e=split(d);
% if ~isempty(e); PID2=e{2}; else PID2=[]; end;
2nd: Kill the process as super user using your private sudo password in the command line. YOU HAVE TO EXCHANGE <yoursudopassword> by your own password without the <> chars.
if ~isempty(PID1); system(sprintf('echo <yoursudopassword> | sudo -S kill -9 %s',PID1)); end;
3rd: Write a loop that checks every second whether the process exists (and uses more that 1% of CPU time)
function spindumpkill
while true
pause(1);
[a,b]=system(sprintf('ps auxww')); c=strsplit(b,char(10))'; d=c(contains(c,'/usr/sbin/spindump','IgnoreCase',true)), e=split(d);
if ~isempty(e); PID1=e{2}; else PID1=[]; end;
if ~isempty(PID1); system(sprintf('echo <yoursudopassword> | sudo -S kill -9 %s',PID1)); end;
end
4th: Start this function as batch process in the background (using the parallel box) or create an OSX-App for that.
batch spindumpkill
  9 commentaires
Walter Roberson
Walter Roberson le 31 Jan 2023
The ID number for batch() is tracking which batch session request this is. Because batch are designed to have the results stay around until collected, the ID number increments for each new batch() request and ID numbers are not reused until you go in and remove the appropriate file that the number is being recorded into. It will not normally reset between sessions, as it is expected that you might drop out of MATLAB and return later to find out how the batch sessions are going.
Walter Roberson
Walter Roberson le 31 Jan 2023
You could potentially create a new APFS volume and install Ventura into it; https://support.apple.com/en-ca/guide/disk-utility/dskutl14027/mac

Connectez-vous pour commenter.

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by