4

My iOS application is crashing randomly in a remote site due to a CPU usage warning, which is not reported in Crashlytics. How do I interpret the warning below?

Event:            cpu usage
Action taken:     none
CPU:              90 seconds cpu time over 162 seconds (55% cpu average), exceeding limit of 50% cpu over 180 seconds
CPU limit:        90s
Limit duration:   180s
CPU used:         90s
CPU duration:     162s
Duration:         162.40s
Duration Sampled: 10.30s
Steps:            11


Hardware model:   iPad7,5
Active cpus:      2
Thetha
  • 35
  • 3
Sri
  • 51
  • 1
  • 2

1 Answers1

3

iOS employs a CPU watcher for background processes. When the CPU usage exceeds 80%, the process will be killed. It's not a "crash" per se but a process kill. The above is just a warning that you might be approaching the allotted CPU limits.

When the crash happens, you can plug the device in xcode and goto Window -> Devices and Simulators -> View Device Logs. The crash report will mention the heaviest stack trace. That should point to the required code.

EDIT:

iOS now provides MetricsKit which allows you to get process kill information (including stack trace) at run time. This can then be uploaded to a sever or you could do Crashlytics.error() to get this info on crashlytics.

sudeepdino008
  • 3,194
  • 5
  • 39
  • 73
  • I'm facing the same issue in one device out of 500. When I checked the heaviest stack trace texts are in number format not in the text. How can I find out this. Pls help. I want to find the root cause. – Chandrapandian J Oct 13 '20 at 05:57
  • Sounds like a dSYMs issue. This might get you started - https://stackoverflow.com/questions/28941656/what-are-debug-symbols-in-xcode – sudeepdino008 Oct 13 '20 at 13:36
  • Happens to me when I have Safari dev tools open on my macbook for debugging the running iOS app, quitting Safari no longer causes crashes on the connected iPad. – Michelle Norris Jun 27 '22 at 15:21