getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
812 stars 323 forks source link

Reporting memory information while app is crashing due to low memory. #3680

Closed barisyild closed 8 months ago

barisyild commented 8 months ago

Problem Statement

If the application crashes due to insufficient memory or is terminated by watchdog, we do not know the last memory usage of the application.

Solution Brainstorm

Every 10 seconds memory usage can be logged, then after the application crashes, the latest memory usage from the log can be sent to the sentry.

Are you willing to submit a PR?

No response

brustolin commented 8 months ago

Thanks @barisyild for reaching out.

If the app was killed because of low memory, it means the last memory usage was the maximum iOS offers for apps, since the foreground app has preference for most of the memory available in the OS.

In my opinion, saving the memory usage every 10 seconds doesn't help too much since memory usage can vary a lot in a shorter time range.