WordPress-iOS
WordPress-iOS copied to clipboard
WatchdogTermination: The OS watchdog terminated your app, possibly because it overused RAM.
Sentry Issue: JETPACK-IOS-1NA
WatchdogTermination: The OS watchdog terminated your app, possibly because it overused RAM.
By July 3rd, 2023, this issue affected 875 users. Based on the error description, it looks like an issue with memory pressure.
Related subtasks:
- https://github.com/wordpress-mobile/WordPress-iOS/issues/21075
- https://github.com/wordpress-mobile/WordPress-iOS/issues/21010
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21013
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21015
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21038
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21040
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21051
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21052
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21053
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21062
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21063
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21064
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21066
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21068
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21161
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21156
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21120
- https://github.com/wordpress-mobile/WordPress-iOS/issues/21197
- https://github.com/wordpress-mobile/WordPress-iOS/pull/21254
- The issue appears from 22.3 because Sentry started reporting it this way from version 8.0.0 which we updated for 22.3
- The most common reason is
Out Of Memory
issue. The cases where the app gets killed after having the main thread blocked for a prolonged time are reported together withApp Hangs
- Log inspection suggests that there can be multiple memory related issue causing this
We should approach this issue in multiple ways:
- Inspect code for the most common cases where memory leaks could occur, just as done here for the incorrect usage of notification observers
- Use
Debug Memory Graph
andLeaks
to identify issues at runtime and create separate issues for them
As this is a number one issue by occurrence on Sentry, setting it as [Pri] High
. However, given this issue could be an umbrella for multiple memory leaks, it's unrealistic to expect to solve it in one go, rather we should aim for significant decrease of number of these issues.
I created a subtask:
- https://github.com/wordpress-mobile/WordPress-iOS/issues/21010
Memory issues could be approached in multiple ways. I think at least this one is easy to reproduce and confirm, also it could address some fundamental issues with memory management that happens when the main view of the app appears, without going deeper into other features.
Sentry issue: WORDPRESS-IOS-3Q99
There are a couple of issues with WatchdogTermination events in Sentry:
- It duplicates "regular" crashes. First reported by the Gutenberg team. I reported this issue to Sentry https://github.com/getsentry/sentry-cocoa/issues/3207
- The "overused RAM" message is a guess and is not based on any signals from the OS: there are multiple potential reasons for Watchdog terminations.
As this is a number one issue by occurrence on Sentry, setting it as
[Pri] High
. However, given this issue could be an umbrella for multiple memory leaks, it's unrealistic to expect to solve it in one go, rather we should aim for significant decrease of number of these issues.
I agree with this and find it surprising that Sentry doesn't report any WatchdogTermination
events in the 23.0 beta (which has been out for two weeks. I ruled out the possibility of Sentry reporting this into a different Sentry issue (as it sometimes creates duplicates), but that doesn't appear to be the case. JETPACK-IOS-1NA is the only issue for WatchdogTermination
.
One explanation could be that 23.0's beta userbase is too small for this issue to occur, so we'll have to wait another week to see if WatchdogTermination
events occur (we can expect some).
Update: There are four events in the 23.0 and we're two days into the release. There were 126 events two days into the 22.9, so this is encouraging. However, Sentry is dropping some events due to quota limits, so that could affect this.
Update: WatchdogTermination is still one of the top 5 crashes, but most crash occurrences happen within versions 23.6 to 24.1. Currently, there are 5 events for 24.2, about three days after release.
Sentry Issue: JETPACK-IOS-1NA
Thanks for reporting! 👍