Why does MATLAB get stuck in the "Initializing" or "Busy" state or take a long time to start?

1 664 views (last 30 days)
MATLAB opens but the status states 'Initializing' or 'Busy' for a long time. MATLAB takes a long time to launch with or without a remote license manager.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 12 Sep 2022
Edited: MathWorks Support Team on 12 Sep 2022
When MATLAB opens with "Initializing" or "Busy" for an extended period of time, the MATLAB installation may be experiencing a licensing issue.  This article will go provide information on:
  • Is this a licensing issue?
  • Licensing solutions
  • Non-licensing solutions
Is this a licensing issue?
To determine whether a slow startup is a licensing issue or not, please attempt to start MATLAB using the “-c” startup flag. To launch MATLAB with a startup flag, please open a command prompt/terminal window and enter the path to the MATLAB executable, the “-c” flag, and finally the path to a known working license file. See the following examples:


"$MATLAB\bin\win64\MATLAB.exe" -c <full_path_to_license_file or port@host>

Linux or Mac:

./matlab -c <full_path_to_license_file or port@host>
Note: If symbolic links were not created, run from $MATLAB/bin/. Where $MATLAB is the root MATLAB directory
If this resolves the issue, then a licensing problem is the root cause. If this does not resolve the problem, please scroll further down for “Non-licensing solutions”.
Licensing solutions
Licensing issues may be caused by bad entries on the license search path, such as non-resolvable hostnames and most commonly within an environment variable named LM_LICENSE_FILE or MLM_LICENSE_FILE. These variables tell MATLAB and other FlexNet applications where to find the license file. For additional information about environment variables and how they are set please refer to the following article:
MATLAB can experience a long delay as it attempts to communicate with these other computers or license servers. License servers listed that can be communicated with but do not have a license manager running can potentially cause this issue as well. Additionally, if you have borrowed a license and then left the network where the license was borrowed from, MATLAB startup may also be delayed.
Follow the below steps to resolve the issue.

1. Determine the problematic license file or environment variable.

Once MATLAB has started run a license checkout test to determine which license file is problematic. The following commands will list the license paths it has found and how long it spent trying a checkout:
matlab.internal.licensing.pathTest % (This will test MATLAB’s current license search path)
matlab.internal.licensing.pathTest(pathToTest) % (This will test a specific license search path)
Note that an individual license will give “No MATLAB Feature exists on the path” despite MATLAB successfully checking out from this license. A network license will not provide this error.
For releases prior to R2017a, some trial and error is required to determine the exact license file or environment variable that is causing the delay. Please run the following command to see the entire search path that MATLAB utilizes to find license files:
feature lmsearchpath
Once you have determined all the license files in the search path, try removing suspected bad license entries (i.e. network licenses).

2. Remove the offending license file or work w/ local IT to resolve network issues.

Any license files or environment variables that is pointed towards a network location that is no longer accessible should be removed.
If instead the license is pointed towards a network location that is accessible, but is the cause of the delayed startup please work with your local IT department to determine the source of the issue. In many cases security software or restrictive IT policies may be the culprit.
Non-licensing solutions

Solution 1

Often a corrupt preferences directory can prevent MATLAB from starting correctly. Please attempt to recreate the MATLAB preferences directory, the instructions are available in the following article:

Solution 2

Similar to the preferences folder, the following MATLAB folder may cause this issue:
To resolve, rename or delete the R2XXXx folder, then create a new R2XXXx.
Note: The R2XXXx corresponds to the release of MATLAB.

Solution 3

In some instances, customers have reported that the anti-virus application which was working in the background, was slowing down MATLAB. For these customers, disabling the “active scan’ option for at least the MATLAB directories improved performance substantially.
In particular, Kaspersky Endpoint Security 10 for Windows (MR3.pf1800)  has been found to slow MATLAB startup. Updating it to version has helped customers resolve this.

Solution 4

In some cases, when you put an invalid character in the filename while saving a file, this issue may arise.However, some invalid characters like /, \ , present in filename does not hang MATLAB, while other characters does (<,>,”,|,:).
For example, the following command executes successfully:
uiputfile({'*.*','All Files (*.*)'}, 'Save As',fullfile(pwd,'a 1/20'))
But the following command keeps MATLAB busy:
uiputfile({'*.*','All Files (*.*)'}, 'Save As',fullfile(pwd,'a 1<20'))

Solution 5

MATLAB might be attempting to access files from a sluggish network. Check output of “path” to ensure that all the directories are local. Remove any network drives to see if there is any improvement.

Solution 6

In some rare cases the preference settings in MATLAB may negatively affect startup performance. The following steps ensure the toolbox cache settings are set back to the default:
  1. In the MATLAB toolstrip, click on “Home” and then on the “Preferences” button.
  2. Inside the “Preferences” window, select “MATLAB -> General” on the left-hand side.
  3. On the right-hand side, verify that “Enable toolbox path cache” is enabled.
Another possible preference that may negatively affect startup performance is the source-control integration. Please attempt to disable this setting if you do not use any form of source-control integration.
  1. In the MATLAB toolstrip, click on “Home” and then on the “Preferences” button.
  2. Inside the “Preferences” window, select “MATLAB -> General -> Source Control”. on the left-hand side.
  3. Select “None” on the right-hand side and then apply the changes.

Solution 7

If none of the above solutions resolve the issue the “timing” flag can be used as a diagnostic tool that will help determine which process is taking a long time to initialize. To do this, you can run MATLAB from command prompt or terminal by navigating to the bin directory like so:
cd $MATLAB\R20XXx\bin
Where $MATLAB is the root MATLAB directory
Next execute the following command:
matlab -timing
This will start MATLAB and automatically record the time taken for each startup task. When the startup completes, you will see a log outputted inside the MATLAB Command window that summarizes the timing results. Note that this will also create a text log file noted at the top of the output.

Solution 8

If your Operating System such as Windows, Linux, or MacOS has recently updated, make sure that the update(s) successfully installed and complete any other updates that need to be installed.
Masoud on 2 Dec 2022
Edited: Masoud on 2 Dec 2022
Hi Davis,
Great Suggestion!
I had the same issue tried every recommended solutions and I saw nobody else mentioning that there is also another matlab file. I changed the Matlab folder also In Local location and It works now.

Sign in to comment.

More Answers (17)

Kouichi C. Nakamura
Kouichi C. Nakamura on 26 May 2016
I had been using MATLAB with network licence. In my Mac, the license file xxxx.lic is stored in Applications/MATLAB_R2015b.app/licenses/.
I recently moved to another institution, and hence the licence has been changed. I used Applications/MATLAB_R2015b.app/Activate.app to change the licence. It was successful, but since then launching became extremely slow.
I tried a method mentioned above and renamed .matlab/R2015b folder to .matlab/R2015b_old, but did not help.
I looked at /Applications/MATLAB_R2015b.app/licenses again and noticed that now this folder contains two ~.lic files. So I deleted the older xxxx.lic file, and that was it.
It seems that if the /Applications/MATLAB_R2015b.app/licenses folder contains two conflicting license files MATLAB cannot decide which one to comply and takes a long time to be initialized.

Sign in to comment.

chart on 3 Aug 2017
Edited: chart on 3 Aug 2017
I also have this issue, but I am unable to complete many of the steps outlined above because I cannot access the MATLAB prompt (>>). The prompt never appears because the application state is always "Initializing...".
I have tried restarting the application, restarting my computer, recreating my preferences and even reinstalling the application, but the problem has persisted.
I have ensured that the MLM_LICENSE_FILE environment variable to indicate the appropriate server. I can successfully launch the application and get to the "Initializing..." state with both
"$MATLAB\bin\win64\MATLAB.exe" -c < port@host > (appropriate values replaced for my organization)
matlab.exe -timing
but because the application never finishes its initialization no log is produced to help me troubleshoot what is wrong.
I know that the licensing was properly configured during the first installation because the application behaved normally for a time after installation including access to several toolboxes.
If there are any other steps that I can try, particularly those which I am able to access without requiring a MATLAB prompt, the help is much appreciated.
Thank you.

Sign in to comment.

XINCHENG WANG on 10 Jun 2021
One of the easist way to solve the matlab slowly boost could be:
  • Open cmd, then input the following script and enter.
  • "C:\Program Files\MATLAB\R2020b\bin\MATLAB.exe" -c C:\Users\xincheng\AppData\Roaming\MathWorks\MATLAB\R2020b_licenses
Harry on 21 Aug 2022
This should be the main answer.
In my case, the issue seems to be that I have an LM_LICENSE_FILE environment variable defined on my system, but which is needed by other software (not MATLAB). That environment variable points to a port on a remote server. If I'm not connected to the network where that remote server resides, then MATLAB spends a silly amount of time trying to connect to it (even though my MATLAB licence isn't provided by that server, it's stored locally on my PC).
The -c flag overcomes this problem by specifying the path to my local license file, so no time is wasted attempting to connect to the unavailable remote server.

Sign in to comment.

Moulai Sidi  Mohammed
Moulai Sidi Mohammed on 23 Oct 2017
just found the solution, u have to add a system variable LM_LICENSE_FILE with value address of the license file in your system and then restart. right click on win button > system > advanced system setting >environment values
add the variable as said above in the system variables .

Sign in to comment.

AJC on 17 Oct 2017
Edited: Walter Roberson on 17 Oct 2017
same issues here. Timer doesn't tell me much apart from "something" is causing a long delay. The license files seem OK too. No clue what the 4 min delay is all about? See longs below:
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
* 0.00 0.00 0.00 MATLAB script
* 0.15 0.15 0.00 main
* 0.41 0.26 0.00 Session Initialize
* 0.57 0.02 0.14 LM Startup
* 0.63 0.00 0.06 splash
* 1.15 0.13 0.38 Constant Initialization
* 1.80 0.65 0.01 InitSunVM
* 2.76 0.92 0.03 PostVMInit
* 2.76 1.60 0.01 mljInit
* 7.06 4.27 0.02 StartDesktop
* 7.06 5.90 0.01 Java initialization
* 7.17 0.00 0.11 psParser
* 7.23 0.04 0.01 cachepath
* 8.48 1.16 0.10 matlabpath
* 8.53 0.00 0.06 SettingsConstructorLoadingFiles
* 8.53 0.01 0.05 SettingsConstructorLoadingFiles
* 9.27 2.04 0.00 matlabrc
* 10.15 3.10 7.06 Init Desktop
* 223.08 216.02 7.06 Ready
Items shown account for 100.7% of total startup time [TIMER: 2 MHz]
Determining checkout time for MATLAB.
MATLAB's license search path is :
C:\Users\acollins\AppData\Roaming\MathWorks\MATLAB\R2017b_licenses\license_XIRACOLLINS31_399358_R2017b.lic;C:\Program Files\MATLAB\R2017b\licenses\license.dat;C:\Program Files\MATLAB\R2017b\licenses\*.lic
Checkout time 8 milliseconds. No MATLAB feature exists on the path (status -8)
C:\Program Files\MATLAB\R2017b\licenses\license.dat
No License File exists on this path.
C:\Program Files\MATLAB\R2017b\licenses\*.lic
No License File exists on this path.
Ashween Peiris
Ashween Peiris on 6 Jan 2018
I did the same thing,but after I disconnected from the internet. It opened much quicker. So disconnecting before launch and reconnecting "works".
Toolbox Path Cache read in 0.05 seconds.
MATLAB Path initialized in 1.07 seconds.
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
0.00 0.00 0.00 MATLAB script
0.06 0.06 0.00 main
0.51 0.45 0.00 Session Initialize
0.66 0.03 0.12 LM Startup
0.76 0.00 0.10 splash
1.25 0.17 0.32 Constant Initialization
1.69 0.43 0.02 InitSunVM
2.44 0.71 0.03 PostVMInit
2.44 1.17 0.02 mljInit
3.06 0.60 0.03 StartDesktop
3.06 1.79 0.02 Java initialization
3.17 0.00 0.11 psParser
3.23 0.05 0.01 cachepath
4.38 1.07 0.08 matlabpath
4.44 0.00 0.06 SettingsConstructorLoadingFiles
4.44 0.01 0.06 SettingsConstructorLoadingFiles
5.01 1.78 0.00 matlabrc
5.52 2.47 3.06 Init Desktop
7.39 4.33 3.06 Ready
Items shown account for 117.2% of total startup time [TIMER: 2 MHz]
When I checked for my licences, this was the result;
>> matlab.internal.licensing.pathTest
Determining checkout time for MATLAB.
MATLAB's license search path is :
C:\Program Files\MATLAB\R2017b\licenses\license.lic;C:\Users\Ashween\AppData\Roaming\MathWorks\MATLAB\R2017b_licenses\license_RAZOR_678256_R2017b.lic;C:\Program Files\MATLAB\R2017b\licenses\license.dat
C:\Program Files\MATLAB\R2017b\licenses\license.lic
Checkout time 15 milliseconds. No MATLAB feature exists on the path (status -8)
Checkout time 14 milliseconds. No MATLAB feature exists on the path (status -8)
C:\Program Files\MATLAB\R2017b\licenses\license.dat
No License File exists on this path.

Sign in to comment.

John Anderson
John Anderson on 21 Apr 2018

One other approach I have found to be effective is to

  • Deactivate Matlab
  • Browse to the licensing folder : C:\Program Files\MATLAB\R2017b\licenses
  • Delete the contents of this folder
  • Reactivate Matlab

I appeared to have some legacy licensing files that even though I had performed a clean install of Matlab 2017b were still hanging around. My initialization is reduced from 20mins+ to 20 seconds.

Jim Riggs
Jim Riggs on 16 Nov 2018
I also recently encountered this problem, but in my case the soltion was different.
I am running 2016b. I went to save some large data structures into a file, but in my save command I inadvertently specified a .m file type. It apears that Matlab immediately interpreted this file as a script and attempted to read it, and became locked up. When I closed Matlab and attemped to restart the program, it became locked up with the status "initializing". After Two days of fiddling around, I discovered that when this errant file is removed from the Matab folder, Matlab starts and runs just fine. As soon as the offending file is copied back into the Matlab folder, Matlab crashes, even if it is just sitting idle.

Jaswanth Kumar Reddy Ambhati
Edited: Jaswanth Kumar Reddy Ambhati on 1 Oct 2020
I had installed R2020b assuming my R2019b was corrupted because it had "stuck at initialising" issue. However, reinstalling my matlab didn't work. It seems my preferenes were corrupt and I followed the steps mentioned under Problem 1 in the below link:

Iron Shannon
Iron Shannon on 27 Oct 2021
The same issue I had encounted! I tried to solve the problem as follows,
  1. Follow the steps of the accepted answer. Issue remains.❌
  2. Update MATALB using "update_installer.exe" which is a built-in application of MATLAB under the installation folder. Issue remians.❌
  3. Update Windows 10 OS from 2004 to 21H1. Issue solved! ✔
My software environment: MATLAB R2018b & MATLAB R2020b + Win10 2004.
Hope my method can help you!

emmanouil protonotarios
emmanouil protonotarios on 1 Feb 2018
I tried everything here and nothing worked for the 2016a version. I experimented with my path and realized one entry generates the delay. I spent 3 hours trying to identify the culprit but it turned out these were 3. Three folders created the problem a delay of 1 minute. In these folders i had 70,000 mat files. It seems in the initialization process these (maybe their names) are scanned and this caused the delay for me. Now initialization takes 2 seconds. I hope someone will find this useful.

salma taik
salma taik on 9 Aug 2018
hi guys if someone is still having this problem i guess i kinda found a solution that worked for me. i struggled the whole day with it i tried what is mentioned above and nothing worked. It happened that i deleted the temporary files in the laptop and it worked just fine.

Philipp stenzel
Philipp stenzel on 11 Sep 2018
Hello, I also got this problem with my MATLAB Version 2017b,and no solution is working for me. Can maybe please someone help me.
I only get the normal start-up, if I turn off my internet, after he found the licenses. But I don't think that this is a normal start for this software.
if true
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
0.00 0.00 0.00 MATLAB script
0.21 0.21 0.00 main
0.87 0.66 -0.00 Session Initialize
6.63 5.62 0.14 LM Startup
6.69 0.00 0.06 splash
7.36 0.18 0.49 Constant Initialization
8.91 1.53 0.01 InitSunVM
10.00 1.06 0.03 PostVMInit
10.00 2.62 0.01 mljInit
16.06 6.04 0.02 StartDesktop
16.06 8.68 0.01 Java initialization
16.08 0.00 0.02 psParser
17.17 0.08 1.01 cachepath
19.39 2.11 0.12 matlabpath
19.71 3.65 16.06 Init Desktop
66.86 0.00 47.46 SettingsConstructorLoadingFiles
66.86 0.01 47.46 SettingsConstructorLoadingFiles
67.66 50.49 0.00 matlabrc
269.41 253.35 16.06 Ready
Items shown account for 118.5% of total startup time [TIMER: 2 MHz]
% Start and turn Internet off
total item gap description
0.00 0.00 0.00 MATLAB script
0.19 0.19 0.00 main
0.81 0.62 0.00 Session Initialize
6.86 5.91 0.14 LM Startup
6.93 0.00 0.07 splash
7.53 0.17 0.43 Constant Initialization
9.15 1.61 0.02 InitSunVM
10.32 1.14 0.03 PostVMInit
10.32 2.77 0.02 mljInit
21.17 10.82 0.03 StartDesktop
21.17 13.62 0.02 Java initialization
21.19 0.00 0.01 psParser
21.29 0.10 0.01 cachepath
23.44 2.03 0.12 matlabpath
23.57 0.00 0.13 SettingsConstructorLoadingFiles
23.57 0.01 0.13 SettingsConstructorLoadingFiles
23.92 2.75 21.17 Init Desktop
24.35 3.05 0.00 matlabrc
26.77 5.60 21.17 Ready
Items shown account for 109.3% of total startup time [TIMER: 2 MHz]
  1 Comment
DGM on 2 Aug 2021
With R2019b, I had a very similar experience with variable, often extremely long intitialization times. Disconnecting from the network cut the times down to about 15s. At least for me, disabling the source control option in preferences fixed the issue.

Sign in to comment.

TripleSSSS on 12 Aug 2019
I ended up spending three hours for this problem. the problem itself accured after sevaral windows 7 updates.
I ended up uninstalling and reinstalling Maltab 2018B, now everything works fine.

micronaut on 29 Apr 2020
Edited: micronaut on 29 Apr 2020
old thread, but I'm on R2018a and noticed that using a license server, Matlab stalls with "Busy" every 5 or so function calls for a few seconds. I have also set up Matlab to borrow the license and the stall gets even longer. Last night, for example Matlab was hanging for 30 seconds every 4 or 5 operations. I am presuming it is pinging a license server somewhere (even though it's "borrowed") all the time? It would be great if there was a solution to this as it's incredibly annoying and constantly interupts my workflow. It also adds significant execution time to my scripts which is rediculous.
  1 Comment
Sam Trossman
Sam Trossman on 12 May 2020
If you've already tried the troubleshooting from the "Accpeted Answer" above for "Licensing" and "Non-Licensing" issues, but still experience the same slowness, I recommend you reach out directly to MathWorks Support.

Sign in to comment.

Davis Crowell
Davis Crowell on 13 Aug 2021
There are two matlab folders to rename:
rename the matlab 2020b folder under C:\Users\%username%\AppData\Roaming\MathWorks\MATLAB\2020b to 2020b_OLD
rename the matlab 2020b folder under C:\Users\%username%\AppData\Local\MathWorks\MATLAB\R2020b to R202b_OLD
Start Matlab 2020b and both folders will be recreated and issue will be resolved.
Change 2020b to the version of Matlab you are using.

Remna Radhakrishnan
Remna Radhakrishnan on 29 Nov 2021
I had the similar issue with r2021b. The following steps I did to resolve the issue
  1. Uninstalled r2021b
  2. Re-installed the latest version of r2021b
  3. Deleted C:\Users\%username%\AppData\Roaming\MathWorks\MATLAB\R2021b folder and created a new empty folder with the same name (R2021b) . If required, take the backup of existing R2021b folder as R2021b-backup
  4. Repeat the same steps for the following folder - C:\Users\%username%\AppData\Local\MathWorks\MATLAB\R2021b
  5. Start Matlab

Ryan Gray
Ryan Gray on 6 Apr 2022
Another possibility is that due to corporate configuration, the AppData folder gets stored on a network share, and MATLAB stores its preferences folder there by default. This can make it very slow to unusable. You will have to set the MATLAB_PREFDIR environment variable to point to a local folder. If your IT is very restrictive, you may only be able to locally write in C:\Users\%USERNAME%, so make a folder there. Just remember that the contents are particular to each MATLAB version. These day, it seems common to have the Documents folder on a network redirect as well, so you might have to consider changing your userpath to something local as well. I would also check that TMP and TEMP folders are local rather than on a network path.


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


No tags entered yet.


Community Treasure Hunt

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

Start Hunting!