-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High CPU usage in Energy Organizer, iOS 14+ #1799
Comments
I spend a couple of hours to reproduce the issue and nothing ... So I dig in the code to see what's happening. I focused on 6.7.0/SmartDeviceLink/SDLIAPDataSession.m#L336 as this seems to be the line causing the trouble. My suspicion is the IO thread is in potential risk for an infinity loop! The Apple documentation for NSRunLoop runmode:beforeDate: confirms the suspicion. Here's the quote
After further investigation the only reason for the run loop to immediately return is when both streams (input & output) are removed from the run loop. The reason could be either accidentally by SDL based code or by internal iOS code due to some error. All that without destroying/cancelling the IO thread in the data session instance. My hypothesis is the latter case. iOS removed the NSStream objects from the run loop for whatever reason. I will need to continue testing to find evidence for the hypothesis though. For sure we need to investigate and find the root cause of the issue. Regardless adding robustness code to @joeljfischer this issue is affecting a couple of Ford apps and I also know of concerns to 3rd party apps. Anything that helps resolving this high priority issue is highly appreciated. |
I have received some more information on how to reproduce the issue. Other testers report they have >12 apps and the phone is connected via bluetooth and can reproduce on SYNC3 MY20 which supports iAP via BT. Assuming a USB disconnect could cause some race conditions with so many apps. Precondition:
Action:
Expected behavior:
Observed behavior:
|
Bug Report
We're seeing a lot of reports in the Energy organizer for high sustained CPU usage, and this also appears to be affecting our background battery usage metrics. 99% of these reports seem to be from iOS 14.
Sample of some of the stack traces have some slim details:
There's a good number of others but most follow that same pattern. All of these are logged due to high CPU usage, with messages along the lines of "90 seconds cpu time over 94 seconds (96% cpu average), exceeding limit of 50% cpu over 180 seconds."
We haven't been able to locally reproduce at the moment.
Reproduction Steps
TBD
OS & Version Information
The text was updated successfully, but these errors were encountered: