Slow initialization at startup during the "Ready" step

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.

回答 (3 件)

Guillaume
Guillaume 2024 年 11 月 26 日

1 投票

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 件のコメント

Image Analyst
Image Analyst 2024 年 11 月 26 日
@Guillaume Lion, @Maximilian Pohle presumably called the Mathworks and found a solution but he didn't update us. @Maximilian Pohle, can you post the solution back here in Answers? It can help others with the same problem.
@Guillaume Lion, if he doesn't give us his solution, then you can call the Mathworks yourself and ask for installation help. Please post your problem's resolution back here to help other people.
Guillaume
Guillaume 2024 年 11 月 26 日
It seems that the issue also affects the "Search Documentation" tool... It takes just as long to open the help page.
Image Analyst
Image Analyst 2024 年 11 月 26 日
@Guillaume Lion so how did the Mathworks solve it when you called them?
Guillaume
Guillaume 2024 年 11 月 27 日
I haven't been offered any solutions for the failures of the classic resolution methods. I have disabled all toolboxes, but the issue persists with the core MATLAB product. Since many MATLAB widgets are affected by this slowness, such as "Data Analyzer," "Search Documentation," etc., I tested MATLAB versions 2024a, 2023b, and 2023a using the MPM installation method, as traditional installation is not possible.
All versions exhibit the same issue.
Could there be an incompatibility with the new Linux kernel? In any case, Ubuntu 24.10 seems problematic. I am considering reinstalling version 24.04 LTS.
Image Analyst
Image Analyst 2024 年 11 月 27 日
Who said they can't offer you any solutions? Yes or no -- did you actually call the official Mathworks tech support? If not, why not?
Judd
Judd 2024 年 12 月 1 日
Seeing the same. "MCR 0 interpret" process is pegged near 99% CPU during the entire whatever this three-minute "Ready" thing is up to. Running -nodesktop doesn't have this issue and is able to plot fine, so it's something else.
I attached strace to the "MCR 0 interpret" process and it's basically an endless stream of attempts to close incrementing invalid file ids (the file ids trying to be closed increase by 1 each attempt) during this time so it looks like a bug to me.
Image Analyst
Image Analyst 2024 年 12 月 2 日
Just to be sure youi're starting and ending with a clean slate, start and end your scripts with the statement
fclose('all');
to make sure all files are closed, especially ones you're not aware of because you did not close them manually and explicitly.
Guillaume
Guillaume 2024 年 12 月 16 日
We have carefully tested all the suggested solutions, but unfortunately, none have resolved the issue. Below is a summary of our findings for each proposed step:
1.Classical Tests
-System Requirements: Our system meets all the requirements.
-Graphics Driver: We are using the latest NVIDIA driver (version 560).
-Java Heap Space: Increasing the Java Heap size does not address the problem.
-Disable Java Desktop:
  • Using the -nojvm option allows MATLAB to start in under 2 seconds without invoking the problematic "RMC 0 interpreter" process.
  • With the -nodesktop option (but with java) or -softwareopengl , MATLAB does not immediately accept commands in the terminal. After pressing CTRL+C, commands can be entered (e.g., x=1:10; plot(x)), but the "RMC 0 interpreter" process continues to loop, generating millions of errors (close(xxxxx) = -1 EBADF (Bad file descriptor) for at least 75 seconds => You can find this test video here: https://dl.ipgp.fr/n0lkr80i.
-Parallel Computing: No impact on the issue.
-Profiling Tools: The problem is not related to code performance.
-Network Drive: All scripts and data are stored locally, so this is not the problem.
2. Additional Tests/Informations
- Library Replacement:
  • I replaced the version of libstdc++.so.6 in /usr/local/MATLAB/R2024b/bin/glnxa64/ but it did not resolve the issue.
- Java Version: I switched to OpenJDK, but the problem persists.
- Reproducing the performance issues with New Desktop for MATLAB (Beta) does not resolve the issue.
- I do not use any antivirus on linux and I have also checked the firewall.
3. Observations:
The performance issue appears to be specific to Ubuntu 24.10, affecting MATLAB versions from R2023a to R2024b, irrespective of whether X11 or Wayland is used. The issue is not present in Ubuntu 24.04 LTS.
Using strace during MATLAB initialization, we observed millions of errors like this:
close(666178696) = -1 EBADF (Bad file descriptor)
The "RMC 0 interpreter" process is triggered not only during MATLAB startup, causing a delay of approximately 75 seconds, but also when interacting with any MATLAB applications or even when attempting to open a PDF file in the same folder.
Here, you can find a complete video of these problems : https://dl.ipgp.fr/jbgpnlhq
4. After all these tests, the final response was:
"Ubuntu 24.10 is not a supported operating system for MATLAB R2024b. They have not been tested together, which can cause unexpected behaviour such as the issue that you have been experiencing. Therefore, our recommendation would be to use Ubuntu 24.04, which is a supported system. To learn about other supported operating systems, please see the following documentation link: https://uk.mathworks.com/support/requirements/matlab-linux.html
I hope that this helps."
Dustin
Dustin 2025 年 3 月 20 日
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 2025 年 3 月 22 日
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.

サインインしてコメントする。

Image Analyst
Image Analyst 2024 年 11 月 14 日

0 投票

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 件のコメント

Image Analyst
Image Analyst 2024 年 11 月 15 日
OK and it's been 2 days now. I assume you acted upon my suggestion. What turned out to be the solution?
Maximilian
Maximilian 2024 年 11 月 18 日
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 2024 年 11 月 18 日
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.

サインインしてコメントする。

Filip Rozsypal
Filip Rozsypal 2025 年 1 月 28 日

0 投票

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

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

リリース

R2024b

質問済み:

2024 年 11 月 13 日

コメント済み:

2025 年 3 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by