Matlab r2020a becomes extremely laggy after several hours

1 view (last 30 days)
Hello All,
Within the past month I have come across an issue where matlab becomes extremely laggy (i.e. taking >30 sec to switch between command window and editor, push buttons, typing in the command window, basically everything else too). I have a code that I wrote back in 2019 and have been working with it weekly since then no problem, but within the last month this issue has started to occur. I have found several ways of fixing the issue but non of them work 100% of the time:
1. A simple 'clear all' in the command line works sometimes
2. Closing and rebooting matlab will occationally work
3. Some times i have to restart my entire laptop
4. if all else fails, I perform all prior steps again and leave it for several hourse; eventually it resolves itself.
The code I am working with is approx. 1000 lines long and should have plenty of memory space/ cpu power. I am running matlab on my 2019 macbook pro (i9 2.3 ghz 8-core, 32 gb of ram). I have been working with it for 2 years now and memory requirments can be as low as several mb to several gb; prior to a month ago I had no problems regardless of size. I have even set the working directory to a folder containing only this script, but this does not solve my issue. Does anyone have suggestions on how to diagnos and resolve the problem?
Thanks ahead of time!
Sincerely,
Brennen
  3 Comments
john carr
john carr on 27 Jul 2021
Hey guys, thanks for the quick responses!
@Adam Danz I am not using any remote drives.
@Yongjian Feng I will double check the usage next time the issue occurs. I just tried to force the issue by test a large case of my code and the memory usage didn't exceed 2gb and I still had 20gb free.

Sign in to comment.

Accepted Answer

Walter Roberson
Walter Roberson on 27 Jul 2021
If you are using any window management program such as Magnet, then disable that or configure MATLAB to be excluded.
If you have programs marked as accepted in the Accessibility area of Security preferences then experiment with deauthorizing them, as some of Accessibility actions do not get along well with MATLAB.
For example I have some mouse and camera and game controllers enabled in Accessibility, and I have not had any problems with those myself but similar items are affecting other people (but window management is a much more common cause)
  7 Comments
Walter Roberson
Walter Roberson on 28 Jul 2021
I cannot recommend the Logitech MX Ergo
The thumb trackball works, but thumbs do not give much precision, so the trackball is okay for gross movements across the screen, but not for pointing to particular locations.
(Or at least my thumb does not give much precision.)
The Kensington Wireless Trackball is much better for constant use (but could be better for middle-scroll, so needs improvement for games that rely on middle scroll, such as for throwing and retrieving ropes.)
john carr
john carr on 28 Jul 2021
Ah good to know, I ended up going with the logitech lightspeed gaming mouse. Hopefully this one wont interact with matlab, seems that your experience is a positive sign for logitech mice though.
Thanks again!

Sign in to comment.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!