Slow initialization at startup during the "Ready" step

80 vues (au cours des 30 derniers jours)
Maximilian
Maximilian le 13 Nov 2024
Commenté : Image Analyst le 28 Jan 2025 à 16:40
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.

Réponses (3)

Guillaume
Guillaume le 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.
  8 commentaires
Image Analyst
Image Analyst le 2 Déc 2024
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 le 16 Déc 2024
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."

Connectez-vous pour commenter.


Image Analyst
Image Analyst le 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 commentaires
Maximilian
Maximilian le 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 le 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.

Connectez-vous pour commenter.


Filip Rozsypal
Filip Rozsypal le 28 Jan 2025 à 8:47
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

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Produits


Version

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by