Bug 1376137 - Fix Android memory pressure mapping. r=snorp a=jcristau
authorJan Henning <jh+bugzilla@buttercookie.de>
Tue, 27 Jun 2017 11:22:59 -0700
changeset 414216 ee49e510bc537e858ff68398d8a18140545c6689
parent 414215 b424dea9b108e06cbad74bf7eee92de4a5483a54
child 414217 e8e6d4c68bd3c17e4b78f5ef2906eeb406da8a44
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssnorp, jcristau
bugs1376137
milestone55.0
Bug 1376137 - Fix Android memory pressure mapping. r=snorp a=jcristau The lowest foreground memory pressure level we receive is TRIM_MEMORY_RUNNING_MODERATE, which is then followed by TRIM_MEMORY_RUNNING_LOW, so it's the latter that should trigger MEMORY_PRESSURE_MEDIUM. MozReview-Commit-ID: 6XUrVkfdBm7
mobile/android/base/java/org/mozilla/gecko/MemoryMonitor.java
--- a/mobile/android/base/java/org/mozilla/gecko/MemoryMonitor.java
+++ b/mobile/android/base/java/org/mozilla/gecko/MemoryMonitor.java
@@ -112,20 +112,20 @@ class MemoryMonitor extends BroadcastRec
         }
 
         switch (level) {
             case ComponentCallbacks2.TRIM_MEMORY_RUNNING_CRITICAL:
             case ComponentCallbacks2.TRIM_MEMORY_MODERATE:
                 // TRIM_MEMORY_MODERATE is the highest level we'll respond to while backgrounded
                 increaseMemoryPressure(MEMORY_PRESSURE_HIGH);
                 break;
-            case ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE:
+            case ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW:
                 increaseMemoryPressure(MEMORY_PRESSURE_MEDIUM);
                 break;
-            case ComponentCallbacks2.TRIM_MEMORY_RUNNING_LOW:
+            case ComponentCallbacks2.TRIM_MEMORY_RUNNING_MODERATE:
                 increaseMemoryPressure(MEMORY_PRESSURE_LOW);
                 break;
             case ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN:
             case ComponentCallbacks2.TRIM_MEMORY_BACKGROUND:
                 increaseMemoryPressure(MEMORY_PRESSURE_CLEANUP);
                 break;
             default:
                 Log.d(LOGTAG, "Unhandled onTrimMemory() level " + level);