Slow or Laggy Matlab Workspace

425 views (last 30 days)
Brian on 2 Jan 2015
Answered: Rtf on 7 Apr 2022
Matlab has become unusually unresponsive when I allow it to sit for some time (a few hours to a few days). The type of slowness I'm referring to is simply that the command window, variable editor and code editor are almost non-responsive. A click to activate one of the windows will take 10-30 seconds to respond, rendering the application useless.
I have just over 1GB worth of variables loaded into my workspace but this pales in comparison to the power of my machine (48Gb of RAM and 24 processors). I also have the java heap space turned up to 2.5 GB but still consistently receive a laggy Matlab, even when no variables are open in the editor and no plots have been drawn.
Just to note - as I click the X to close Matlab, even though I have not even opened a code window and Matlab has been sitting idle for 2+ hours - I get the message "An operation is in progress. If the operation does not finish in 20 seconds, Matlab will stop the operation and exit."
ver details - Matlab 2014B 64 bit (v 8.4) Windows 7 Professional V6.1 SP1 Java Version: Java 1.7.0_11-b21 with Oracle Corp Java Hotspot - 64-Bit Server VM mixed mode.
Thanks in advance for your help, Brian
Marcos Guimaraes
Marcos Guimaraes on 27 Jul 2017
I have exactly the same problem. Even to change directory takes seconds

Sign in to comment.

Accepted Answer

Sean de Wolski
Sean de Wolski on 7 Jan 2015
Is your current directory either:
  1. Full of thousands of files?
  2. On a network?
These two reasons are often the cause of lag because MATLAB needs to refresh the path every time it displays the command window.
aacarey on 13 Nov 2015
I was having the same issue. MATLAB starts out quickly, but after some time (a couple of hours or so) it becomes very slow. And I don't mean execution of commands and stuff, but just tabbing through things, typing text, etc. Sometimes it's so bad it can't even open a figure and I get the error UIJ_AreThereWindowShowsPending - timeout waiting for window to show. I'm using R2014a, and I've never had this issue on another computer I have that is running an older version and using the exact same data.
ANYWAY: thanks for pointing out the issue! Switching to C: and back fixes the lagginess for me as well.

Sign in to comment.

More Answers (4)

Jon on 25 Sep 2017
Edited: Jon on 25 Sep 2017
I've been having a similar issue with my 2011b installation where it suddenly became very slow to switch between the Editor and the Command Window, and slow to execute any command from the Command Window. GUIs and figures still responded normally. I tried the solution mentioned above with no effect. My issue ended up being the 'Command History' which I never remember clearing before. Once it was cleared the Command Window started responding immediately again.

Eduardo Gil
Eduardo Gil on 25 Nov 2018
Thanks Sean, you deserve a medal. I am running a 1,000 lines matlab code using Spreadsheet link to exchange data between Excel and Matlab - and all of a sudden the exchange of data between Excel and Matlab starts to run unusually slow. The code runs in 60 seconds. I move the spreadsheet and the matlab code to C: drive - now it runs in 2.5 seconds. It's the freaking network.

David Jessen
David Jessen on 2 Oct 2021
Edited: David Jessen on 2 Oct 2021
I just got MATLAB and I have not done anything, but when I type it laggs, navigating between windows works perfectly
  1 Comment
Niranjan Nanjappa
Niranjan Nanjappa on 1 Feb 2022
I have the exact same issue. Its a new installation of Matlab R2021b and everything works fine apart from the text editor that keeps lagging.

Sign in to comment.

Rtf on 7 Apr 2022
Hi I am having the same problem here and I can not use a local drive because I have to work on a network drive. This is so disapointing and frustrating... Sometimes I need to wait 30 seconds or more for the editor or the comand line to repond again and this is almost happening all the time!! Please is there any solution to that?

Community Treasure Hunt

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

Start Hunting!

Translated by