Reporting app hangs

When your app fails to respond to interactions in real time it causes user frustration and can lead them to abandon your app altogether. Learn how Bugsnag alerts you of app hangs and helps you identify their causes.

An app hang or freeze is a specific instance of the main thread failing to respond in a reasonable amount of time (the threshold) and can be caused by performing CPU intensive work or performing blocking I/O on the main thread.

Bugsnag captures the stack trace of the main thread if an App hang is detected, helping you to identify the underlying cause.

If your app hangs for 10 seconds or longer, it may be terminated by the iOS system watchdog as described in Apple’s documentation.

The system watchdog does not terminate apps launched by Xcode.

App hangs that end with termination by the system watchdog or being force-quit by the user are considered to be “fatal”. By default Bugsang only reports these types of app hangs.

Fatal app hangs are sent to your Bugsnag dashboard when the app next launches.

Enabling reporting of non-fatal app hangs

To enable reporting of non-fatal app hangs, set appHangThresholdMillis to a number of milliseconds.

We recommend setting this to 2000 milliseconds (2 seconds). It can be configured to a minimum of 250 milliseconds (0.25 seconds).

BugsnagConfiguration *config = [BugsnagConfiguration loadConfig];
config.appHangThresholdMillis = 2000;
[Bugsnag startWithConfiguration:config];
let config = BugsnagConfiguration.loadConfig()
config.appHangThresholdMillis = 2000
Bugsnag.start(with: config)

Disabling detection

Bugsnag’s App hang detection can be completely disabled by setting enabledErrorTypes.appHangs to false.

BugsnagConfiguration *config = [BugsnagConfiguration loadConfig];
config.enabledErrorTypes.appHangs = NO;
[Bugsnag startWithConfiguration:config];
let config = BugsnagConfiguration.loadConfig()
config.enabledErrorTypes.appHangs = false
Bugsnag.start(with: config)