Slow initialization at startup during the "Ready" step

57 views (last 30 days)
I have installed Matlab R2024b on a Kubuntu 24.10 system. I installed only Matlab without an Add-ons and had no trouble during installation. Starting the program results in a long initialization time. I tracked the initialization process with the -timing flag. This results in the following output:
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
=========================================================
0.47 0.47 0.00 MATLAB script
0.66 0.20 -0.00 main
0.71 0.05 0.00 Session Initialize
1.99 0.01 1.27 Toolbox cache load Start
1.99 0.44 0.84 Session Initialize
2.33 0.34 1.99 cachepath
2.50 0.11 2.38 LM Startup
2.60 0.10 0.00 splash
3.03 0.20 0.23 Constant Initialization
3.33 0.73 0.00 Engine Startup
3.52 0.20 0.00 InitSunVM
5.01 1.43 0.06 PostVMInit
5.01 1.68 0.00 mljInit
5.72 0.71 0.00 StartDesktop
5.72 2.39 0.00 Java initialization
5.72 0.00 0.00 psParser
5.72 0.00 0.00 Toolbox cache join
5.74 0.01 0.00 Package Registry initialization
6.17 0.21 0.22 matlabpath
7.08 0.19 0.72 matlabrc
7.09 0.00 0.00 Startup File
9.27 3.55 5.72 Init Desktop
217.84 212.12 5.72 Ready
=========================================================
Items shown account for 99.8% of total startup time
As visible, the last step consumes most of the time. Running the program bare with the -nojvm flag results in a quick start (3.92 s) . I already tried to increase the Java Memory heap space, as suggested in https://de.mathworks.com/matlabcentral/answers/1956139-slow-java-initialization-during-startup and tried several solutions from https://de.mathworks.com/matlabcentral/answers/92566-why-does-matlab-get-stuck-in-the-initializing-or-busy-state-or-take-a-long-time-to-start without improving the starting time.
Thanks in advance for any ideas how to resolve this issue.

Answers (3)

Guillaume
Guillaume on 26 Nov 2024
Hi,
I’m experiencing the same issue on Ubuntu 24.10, but it does not occur on Ubuntu 24.04.
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
=========================================================
0.46 0.46 0.00 MATLAB script
0.64 0.18 0.00 main
0.67 0.03 0.00 Session Initialize
1.93 0.10 1.16 Toolbox cache load Start
1.93 0.46 0.80 Session Initialize
2.16 0.23 1.93 cachepath
10.78 8.64 2.13 LM Startup
10.79 0.01 0.00 splash
11.12 0.15 0.18 Constant Initialization
11.24 0.45 0.00 Engine Startup
11.35 0.11 0.00 InitSunVM
12.37 0.97 0.05 PostVMInit
12.37 1.13 0.00 mljInit
12.83 0.46 0.00 StartDesktop
12.83 1.59 0.00 Java initialization
12.84 0.00 0.00 psParser
12.84 0.00 0.00 Toolbox cache join
12.85 0.01 0.00 Package Registry initialization
13.50 0.42 0.23 matlabpath
14.00 0.08 0.41 matlabrc
14.00 0.00 0.00 Startup File
15.62 2.78 12.83 Init Desktop
154.62 141.79 12.83 Ready
=========================================================
Items shown account for 99.8% of total startup time
Did you find a solution ?
Regards.
  10 Comments
Dustin
Dustin on 20 Mar 2025
I realize this is an old thread, but I've been able to mitigate the bad file descriptor issues by setting the nofile kernel limit down low - we're using 2500 now and enforce with docker run options. It seems once we hit the kernel limit some default catch case kicks in and the process completes as expected.
I do think this is a kernel level incompatibility - and it does exist on officially supported platforms (RHEL8/RHEL9).
tl;dr - if you see a high CPU usage MCR interpret you can limit nofile for a mitigation.
infXecc
infXecc on 22 Mar 2025
The nofile limit solution by Dustin above works for me. I started up Matlab like this:
prlimit --pid=$$ --nofile=4096
matlab -desktop
and it get ready in seconds.

Sign in to comment.


Image Analyst
Image Analyst on 14 Nov 2024
I don't think it should take over 3 minutes to start MATLAB. On my old, slow, severely memory- limited 8 GB Windows computer, it takes 50 seconds to launch R2024b. I'd do what it says in the FAQ:
Let us know what the solution turned out to be.
  3 Comments
Maximilian
Maximilian on 18 Nov 2024
Thanks for your reply.
I was hoping that someone else had encountered the same issue and had a solution. It seems I need to contact the support.
Image Analyst
Image Analyst on 18 Nov 2024
Yes, since I believe it's an installation issue, the telephone help should be free. So why wait? There is no reason to wait. Simply call them.

Sign in to comment.


Filip Rozsypal
Filip Rozsypal on 28 Jan 2025
I am experiencing a similar problem on one of two machines running R2024b with Ubuntu 24.10. Using the -timing, I get this:
MATLAB Startup Performance Metrics (In Seconds)
total item gap description
=========================================================
0.28 0.28 0.00 MATLAB script
0.38 0.10 0.00 main
0.40 0.02 0.00 Session Initialize
1.07 0.00 0.67 Toolbox cache load Start
1.07 0.25 0.42 Session Initialize
1.17 0.10 1.07 cachepath
1.27 0.07 1.20 LM Startup
1.27 0.01 0.00 splash
1.49 0.09 0.12 Constant Initialization
1.57 0.29 0.00 Engine Startup
1.65 0.08 0.00 InitSunVM
2.75 1.08 0.03 PostVMInit
2.75 1.18 0.00 mljInit
2.82 0.07 0.00 StartDesktop
2.82 1.25 0.00 Java initialization
2.87 0.05 0.00 psParser
2.87 0.00 0.00 Toolbox cache join
2.87 0.01 0.00 Package Registry initialization
3.08 0.12 0.09 matlabpath
3.34 0.05 0.20 matlabrc
3.34 0.00 0.00 Startup File
4.59 1.78 2.82 Init Desktop
143.33 0.00 139.99 SettingsConstructorLoadingFiles
143.33 0.00 139.99 SettingsConstructorLoadingFiles
143.41 140.59 2.82 Ready
=========================================================
Items shown account for 99.9% of total startup time

Categories

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

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!