Matlab and 'sandbox' process Peak CPU Usage in macOS Big Sur
조회 수: 18 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Walter Roberson
2021년 6월 23일
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
Jonathan Mynard
2022년 1월 19일
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
2022년 12월 10일
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
추가 답변 (4개)
Raphaël Nussbaumer
2021년 12월 11일
Kill this process was the only solution which worked for me. I'm having to do that roughly every 30min.
댓글 수: 0
Tim Lueth
2021년 12월 29일
편집: Tim Lueth
2021년 12월 29일
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)
댓글 수: 0
Matthew Johnson
2022년 4월 29일
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
Tim Lueth
2022년 6월 8일
I have tried this. Unfortunately, it did not help to fix the spindump/sandbox problem on 2021b and OSX10.16.
Tim Lueth
2022년 12월 6일
편집: Tim Lueth
2022년 12월 9일
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
Walter Roberson
2023년 1월 31일
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
2023년 1월 31일
You could potentially create a new APFS volume and install Ventura into it; https://support.apple.com/en-ca/guide/disk-utility/dskutl14027/mac
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!