Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Handle ApplicationExitInfo.REASON_MEMORY_LIMITER in MemoryLimiterIntegration

Đang mở
#6,134 1 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
android, kotlin
Lĩnh vực
mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Android Platform: Java

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.java
  • sentry-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_OTHER
  • exitInfo.getDescription() contains MemoryLimiter:

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 handle REASON_MEMORY_LIMITER in 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_OTHER path 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.

Ngôn ngữ chính
Kotlin
Star
1.4k
Fork
478
Merge trung bình
2 ngày 20 giờ
Pull request đã merge (30 ngày)
71

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/sentry-java

Tất cả issue của getsentry/sentry-java

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.