Handle ApplicationExitInfo.REASON_MEMORY_LIMITER in MemoryLimiterIntegration
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 78/100
Research direction
Start in sentry-android-core/src/main/java/io/sentry/android/core/MemoryLimiterIntegration.java by reading MemoryLimiterPolicy.matches(...), then inspect sentry-android-core/src/test/java/io/sentry/android/core/MemoryLimiterIntegrationTest.kt. Add coverage for ApplicationExitInfo.REASON_MEMORY_LIMITER while preserving the REASON_OTHER plus MemoryLimiter: behavior, and verify compatibility with older SDK stubs and the existing tests.
Written by the indexing model from the issue text.
Description
Summary
MemoryLimiterIntegration currently recognizes MemoryLimiter process deaths only when ApplicationExitInfo.getReason() == REASON_OTHER and the description contains the MemoryLimiter: prefix.
Android 17 / API 37.2 added ApplicationExitInfo.REASON_MEMORY_LIMITER, and our integration does not account for it yet. That means newer platform versions can report a dedicated MemoryLimiter reason that we may fail to capture.
Relevant code:
sentry-android-core/src/main/java/io/sentry/android/core/MemoryLimiterIntegration.javasentry-android-core/src/test/java/io/sentry/android/core/MemoryLimiterIntegrationTest.kt
Android reference:
Current Behavior
MemoryLimiterPolicy.matches(...) currently returns true only when:
exitInfo.getReason() == ApplicationExitInfo.REASON_OTHERexitInfo.getDescription()containsMemoryLimiter:
Expected Behavior
MemoryLimiterIntegration should also recognize exits reported with ApplicationExitInfo.REASON_MEMORY_LIMITER.
We should preserve current behavior for existing REASON_OTHER + MemoryLimiter: records, since older platform behavior may still surface that combination.
Acceptance Criteria
- Update
MemoryLimiterPolicy.matches(...)to handleREASON_MEMORY_LIMITERin addition to the existing legacy path. - Keep backward compatibility for older Android versions / SDK stubs where the new constant may not be available at compile or runtime.
- Add regression tests covering the dedicated MemoryLimiter reason.
- Verify existing tests around the legacy
REASON_OTHERpath still pass.
Notes
The implementation may need to avoid directly referencing the new constant from older compile targets if that creates compatibility issues with our current Android SDK setup.
- Dominant language
- Kotlin
- Stars
- 1.4k
- Forks
- 478
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 70
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from getsentry/sentry-java
-
Bug Java Platform: Java
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
getsentry/sentry-java#6138 · 1 comment ·
-
Feature Java Platform: Java Spans
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-java#5984 · 1 comment ·
-
Android Task Traces
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-java#5376 · 1 comment ·
-
Android Docs Errors
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
getsentry/sentry-java#5375 · 1 comment ·
-
Android good first issue Task User Feedbacks
Difficulty 1/5 1-3 hours Newbie friendliness 68/100
getsentry/sentry-java#5354 · 1 comment ·
All issues in getsentry/sentry-java
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Anthonyy232/Paperize#614 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Issue: Bug
Difficulty 1/5 Under an hour Newbie friendliness 91/100
OpenAPITools/openapi-generator#24978 ·
-
helsemelding-json-schema json-schema-core
Difficulty 2/5 1-3 hours Newbie friendliness 68/100