summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-09-12 02:32:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-12 02:32:55 +0000
commitd7f460936cd5ef8fb5443b303856a36acf6adb33 (patch)
tree4af670d15f3c3c233035989af66eb03e2d4f7502 /services
parent20d97e1ce20a4db23fb1b9799f29744878ecee22 (diff)
parent9d52f791b94bbf03739bdee4ccdd3ecb514c8eeb (diff)
downloadframeworks_base-d7f460936cd5ef8fb5443b303856a36acf6adb33.zip
frameworks_base-d7f460936cd5ef8fb5443b303856a36acf6adb33.tar.gz
frameworks_base-d7f460936cd5ef8fb5443b303856a36acf6adb33.tar.bz2
Merge "Fix issue #17377423: Frequently see 500ms latency on app open..." into lmp-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/am/ProcessList.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ProcessList.java b/services/core/java/com/android/server/am/ProcessList.java
index 1287dce..80d0510 100644
--- a/services/core/java/com/android/server/am/ProcessList.java
+++ b/services/core/java/com/android/server/am/ProcessList.java
@@ -21,6 +21,7 @@ import java.io.OutputStream;
import java.nio.ByteBuffer;
import android.app.ActivityManager;
+import android.os.Build;
import android.os.SystemClock;
import com.android.internal.util.MemInfoReader;
import com.android.server.wm.WindowManagerService;
@@ -230,21 +231,31 @@ final class ProcessList {
Slog.i("XXXXXX", "minfree_adj=" + minfree_adj + " minfree_abs=" + minfree_abs);
}
+ final boolean is64bit = Build.SUPPORTED_64_BIT_ABIS.length > 0;
+
for (int i=0; i<mOomAdj.length; i++) {
int low = mOomMinFreeLow[i];
int high = mOomMinFreeHigh[i];
mOomMinFree[i] = (int)(low + ((high-low)*scale));
+ if (is64bit) {
+ // On 64 bit devices, we consume more baseline RAM, because 64 bit is cool!
+ // To avoid being all pagey and stuff, scale up the memory levels to
+ // give us some breathing room.
+ mOomMinFree[i] = (3*mOomMinFree[i])/2;
+ }
}
if (minfree_abs >= 0) {
for (int i=0; i<mOomAdj.length; i++) {
- mOomMinFree[i] = (int)((float)minfree_abs * mOomMinFree[i] / mOomMinFree[mOomAdj.length - 1]);
+ mOomMinFree[i] = (int)((float)minfree_abs * mOomMinFree[i]
+ / mOomMinFree[mOomAdj.length - 1]);
}
}
if (minfree_adj != 0) {
for (int i=0; i<mOomAdj.length; i++) {
- mOomMinFree[i] += (int)((float)minfree_adj * mOomMinFree[i] / mOomMinFree[mOomAdj.length - 1]);
+ mOomMinFree[i] += (int)((float)minfree_adj * mOomMinFree[i]
+ / mOomMinFree[mOomAdj.length - 1]);
if (mOomMinFree[i] < 0) {
mOomMinFree[i] = 0;
}