MATLAB: Slow or Laggy Matlab Workspace

laggyMATLABperformance issuesslow

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

Best Answer

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.