getsentry / getsentry/sentry-java

Capture Android 17 MemoryLimiter process kills

已關閉
#5,908 4 則留言 2 個 reaction 已指派 1 人 已被 @0xadam-brown 認領 在 GitHub 檢視
Android Errors Feature Platform: Java
主要語言
Kotlin
星號
1.4k
分支
478
平均合併
3 天 4 小時
30 天內合併 PR
72

描述

### Problem Statement

Android 17 (API 37) enforces per-app memory limits based on the device's total RAM. When an app exceeds its limit, the system terminates the process.

This is not a `java.lang.OutOfMemoryError`. No exception is thrown, no signal is raised, and no stack trace is produced — the process simply disappears. Neither `UncaughtExceptionHandlerIntegration` nor the NDK handler sees anything, so the SDK reports nothing at all.

### Solution Brainstorm

AnrV2Integration already polls ActivityManager#getHistoricalProcessExitReasons() at startup and discards everything that isn't REASON_ANR. Memory-limiter kills show up in that same list as REASON_OTHER with getDescription() containing "MemoryLimiter:AnonSwap"

So using that same mechanism doesn't sound too challenging.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。