Closed Bug 2034462 Opened 7 months ago Closed 6 months ago

Investigate impact of App memory limits

Categories

(Firefox for Android :: Tooling, task)

All
Android
task

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: mcarare, Assigned: mcarare)

References

Details

(Whiteboard: [fxdroid][group6] )

Attachments

(1 external file)

Android 17 introduces app memory limits based on the device's total RAM to create a more stable and deterministic environment for your applications and Android users.

In Android 17, limits are set conservatively to establish system baselines, targeting extreme memory leaks and other outliers before they trigger
system-wide instability resulting in UI stuttering, higher battery drain, and apps being killed. While we anticipate minimal impact on the vast majority of app sessions, we recommend the following memory best practices,
including establishing a baseline for memory.

https://developer.android.com/about/versions/17/behavior-changes-all#app-memory-limits

Assignee: nobody → mcarare

Investigation: Android 17 introduces conservative "App memory limits" based on device RAM to prevent system instability. When these limits are hit, the OS kills the app with REASON_OTHER. The documentation specifies that the exit description in ApplicationExitInfo will contain the string "MemoryLimiter:AnonSwap" in these cases. Our current telemetry was bucketizing these into a generic "other" category, changes are needed to measure the impact of this new OS behavior.
We should update ApplicationExitInfoMetrics.kt to inspect the description field when the exit reason is REASON_OTHER, that allows us to establish a baseline for how often Fenix sessions are impacted by Android 17's new memory management policies.

  • Refactored toProcessExitReason to accept the full ApplicationExitInfo object instead of just an integer reason code.
  • Added a check for "MemoryLimiter:AnonSwap" within the exit description when the reason is REASON_OTHER, mapping it to a new "memory_limiter" metric value.

Investigation: Android 17 introduces conservative "App memory limits" based on device RAM to prevent system instability. When these limits are hit, the OS kills the app with REASON_OTHER. The documentation specifies that the exit description in ApplicationExitInfo will contain the string "MemoryLimiter:AnonSwap" in these cases. Our current telemetry was bucketizing these into a generic "other" category, changes are needed to measure the impact of this new OS behavior.
We should update ApplicationExitInfoMetrics.kt to inspect the description field when the exit reason is REASON_OTHER, that allows us to establish a baseline for how often Fenix sessions are impacted by Android 17's new memory management policies.

Status: NEW → ASSIGNED
Pushed by mcarare@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9d6dad9c322a https://hg.mozilla.org/integration/autoland/rev/ea6345e4d89d Refine `ApplicationExitInfo` reason mapping to identify MemoryLimiter exits. r=android-reviewers,kaya
Pushed by ctuns@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/46c1768ababa https://hg.mozilla.org/integration/autoland/rev/d206131b047b Revert "Bug 2034462 - Refine `ApplicationExitInfo` reason mapping to identify MemoryLimiter exits. r=android-reviewers,kaya" for causing fenix failures in ApplicationExitInfoMetrics.kt

Backed out for causing lint failures

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: file:///builds/worker/checkouts/gecko/mobile/android/fenix/app/src/main/java/org/mozilla/fenix/perf/ApplicationExitInfoMetrics.kt:59:38: error: Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:
Flags: needinfo?(mcarare)
Pushed by mcarare@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/95f5f34b21a4 https://hg.mozilla.org/integration/autoland/rev/647808860f2a Refine `ApplicationExitInfo` reason mapping to identify MemoryLimiter exits. r=android-reviewers,kaya
Status: ASSIGNED → RESOLVED
Closed: 6 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
Flags: needinfo?(mcarare)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: