[2021a] Hanging for several minutes in getSettingsRoot/mlock
조회 수: 6 (최근 30일)
이전 댓글 표시
I've been noticing an intermittent issue where MATLAB will take several minutes to run a piece of code instead of the usual <1 second. This occurs across many functions with no apparent pattern.
When I hit "Pause" in the debugger it always gives control back on line 2 of matlab.internal.getSettingsRoot, calling mlock. Running dbstack shows the call stack at sort of nonsensical locations, such as an if isempty() call.
This just started happening in the last few days and my colleagues are unable to reproduce this at all. When I use the "Step Out" feature of the debugger I can copy-paste the function call that took several minutes and then it takes less than a second, so I can't even reproduce it on the same piece of code.
My only guess is it has something to do with MATLAB internally checking my license or something? Maybe an issue with the debugger? Any help would be greatly appreciated, I found very little information regarding the purpose of getSettingsRoot.
댓글 수: 3
G Bielsa
2022년 10월 13일
Hi, Im facing the same issue. Matlab gets stuck in that function, but unfortunately in my case, the simulations that should take an hour take couple of hours...
Julian H
2023년 11월 4일
I am facing the same issue on MATLAB 2022b. It's very hard to trace what is actually causing this since the origin of the paused call stack seems almost arbitrary. It just always ends at C:\Program Files\MATLAB\R2022b\toolbox\matlab\configtools\+matlab\+internal\getSettingsRoot.m line 2.
Depending on the code structure, it is possible to breakpoint, go up the call stack, and just F9 the subsequent code. But that obviously only works if it gets stuck at the highest call level.
Ctrl + C also doesn't work in this scenario, nor does trying to close the application normally. It is necessary to kill the MATLAB process to get out of it.
If I profile my code, I get this as the main time sink:
ParallelSettingsUpgrader>iGetVersionSetting (Calls: 1, Time: 1301.653 s)
with most time spent on
if ~parallelRoot.hasGroup(ParallelSettingsTree.VersionNodeName)
답변 (1개)
Pratik
2024년 2월 14일
Hi Russell,
As per my understanding, there is siginficant slow down in performance of your MATLAB code and MATLAB gets "stuck" in the mlock in getSettingsRoot.
From the limited information available, it can be deduced that the issue can be because of the Version upgrade of MATLAB. Due to change in architecture of some function, it might have significantlly slowed down.
As a workaround to this issue, previous version of MATLAB can be used. However, if it is necessary to use the latest version, you may need to restructure your code to reduce the number of calls to the function. MATLAB Profiler can be used to identify the bottleneck function.
Please refer to the documentation of MATLAB Profiler for more information:
I hope this helps!
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Scope Variables and Generate Names에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!